diff --git a/Make.inc b/Make.inc index 647ffe4..be08260 100644 --- a/Make.inc +++ b/Make.inc @@ -1,5 +1,5 @@ CC=gcc -CFLAGS=-std=c99 -O2 -fPIC -I. -I../include -I../ld128 -I../src -D__BSD_VISIBLE -Wno-implicit-function-declaration +CFLAGS=-O2 -fPIC -I. -I../include -I../ld128 -I../src -D__BSD_VISIBLE -Wno-implicit-function-declaration default: all @@ -19,6 +19,7 @@ endif ifeq ($(OS), Darwin) SHLIB_EXT = dylib +CFLAGS+=-std=c99 endif # Colors for make diff --git a/src/Makefile b/src/Makefile index fcaa62b..f4cee00 100644 --- a/src/Makefile +++ b/src/Makefile @@ -39,12 +39,13 @@ SRCS+= s_copysignl.o s_fabsl.o s_llrintl.o s_lrintl.o s_modfl.o # If long double != double use these; otherwise, we alias the double versions. SRCS+= e_acosl.o e_asinl.o e_atan2l.o e_fmodl.o \ e_hypotl.o e_remainderl.o e_sqrtl.o \ - s_atanl.o s_cbrtl.o s_ceill.o s_cosl.o s_cprojl.o \ + s_atanl.o s_ceill.o s_cosl.o s_cprojl.o \ s_csqrtl.o s_floorl.o s_fmal.o \ s_frexpl.o s_logbl.o s_nexttoward.o \ s_remquol.o \ s_sinl.o s_tanl.o s_truncl.o w_cabsl.o \ s_nextafterl.o s_rintl.o s_scalbnl.o +# s_cbrtl.o # C99 complex functions SRCS+= s_ccosh.o s_ccoshf.o s_cexp.o s_cexpf.o \ diff --git a/src/math_private.h b/src/math_private.h index 4044ed0..24b68ae 100644 --- a/src/math_private.h +++ b/src/math_private.h @@ -18,7 +18,30 @@ #define _MATH_PRIVATE_H_ #include + +#ifdef __APPLE__ #include +#ifdef __arm__ +#if defined(__VFP_FP__) +#define IEEE_WORD_ORDER BYTE_ORDER +#else +#define IEEE_WORD_ORDER BIG_ENDIAN +#endif +#else /* __arm__ */ +#define IEEE_WORD_ORDER BYTE_ORDER +#endif +#endif + +#ifdef __linux__ +#include +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define IEEE_WORD_ORDER LITTLE_ENDIAN +#endif +#if __BYTE_ORDER == __BIG_ENDIAN +#define IEEE_WORD_ORDER BIG_ENDIAN +#endif +#endif + #include /* @@ -39,16 +62,6 @@ * ints. */ -#ifdef __arm__ -#if defined(__VFP_FP__) -#define IEEE_WORD_ORDER BYTE_ORDER -#else -#define IEEE_WORD_ORDER BIG_ENDIAN -#endif -#else /* __arm__ */ -#define IEEE_WORD_ORDER BYTE_ORDER -#endif - #if IEEE_WORD_ORDER == BIG_ENDIAN typedef union diff --git a/src/openlibm.h b/src/openlibm.h index 01576a1..0e9efdd 100644 --- a/src/openlibm.h +++ b/src/openlibm.h @@ -18,8 +18,18 @@ #define _MATH_H_ #include +#ifdef __APPLE__ #include #include +#endif + +#ifdef __linux__ +#include +#include +#define __pure2 +#endif + + /* * ANSI/POSIX