Skip to content

Commit

Permalink
Fix for math-library compatibility on MacOS (#798)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-appel authored Dec 6, 2024
1 parent 8688af9 commit 426c7f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/CoqMakefile.local
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CFLAGS=-I$(INCLUDE)
CC=gcc

proof/math_extern.v: $(SRC)/math_extern.c
clightgen -flongdouble -normalize $< -o $@
clightgen -flongdouble -normalize -DCOMPCERT $< -o $@

proof/malloc_extern.v: $(SRC)/malloc_extern.c
clightgen -normalize $< -o $@
Expand All @@ -23,7 +23,7 @@ test/incr.v: test/incr.c
test/incr_main.v: test/incr_main.c
clightgen -I$(INCLUDE) -normalize $<
test/testmath.v: test/testmath.c
clightgen -I$(INCLUDE) -normalize $<
clightgen -I$(INCLUDE) -normalize -DCOMPCERT $<

tests: test/incr

Expand Down
3 changes: 3 additions & 0 deletions lib/proof/src/math_extern.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifdef COMPCERT
typedef float _Float16; /* _Float16 is a MacOS thing that CompCert doesn't support */
#endif
#include <math.h>

/* Note regard 'long double':
Expand Down
3 changes: 3 additions & 0 deletions lib/test/testmath.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifdef COMPCERT
typedef float _Float16; /* _Float16 is a MacOS thing that CompCert doesn't support */
#endif
#include <math.h>

double f(double t) {
Expand Down

0 comments on commit 426c7f4

Please sign in to comment.