diff --git a/include/fpmath.h b/include/fpmath.h index cb5819a..49c44e5 100644 --- a/include/fpmath.h +++ b/include/fpmath.h @@ -55,6 +55,9 @@ #define _BYTE_ORDER BYTE_ORDER #endif +#ifdef __FreeBSD__ +#include +#endif #ifdef WIN32 #define _LITTLE_ENDIAN 1234 @@ -112,4 +115,4 @@ union IEEEd2bits { } bits; }; -#endif \ No newline at end of file +#endif diff --git a/src/math_private.h b/src/math_private.h index 1c62643..a9dd508 100644 --- a/src/math_private.h +++ b/src/math_private.h @@ -303,7 +303,7 @@ irint(double x) { int n; - asm("cvtsd2si %1,%0" : "=r" (n) : "x" (x)); + __asm__("cvtsd2si %1,%0" : "=r" (n) : "x" (x)); return (n); } #define HAVE_EFFICIENT_IRINT @@ -315,7 +315,7 @@ irint(double x) { int n; - asm("fistl %0" : "=m" (n) : "t" (x)); + __asm__("fistl %0" : "=m" (n) : "t" (x)); return (n); } #define HAVE_EFFICIENT_IRINT diff --git a/src/s_nan.c b/src/s_nan.c index f9d2ac8..314b7a9 100644 --- a/src/s_nan.c +++ b/src/s_nan.c @@ -36,7 +36,7 @@ #include "math_private.h" -#if !defined(__APPLE__) +#if !defined(__APPLE__) && !defined(__FreeBSD__) static __inline int digittoint(int c) { if ('0' <= c <= '9') return (c - '0');