Forráskód Böngészése

fixes for freebsd9

Mike Nolta 12 éve
szülő
commit
ec53659c6a
3 módosított fájl, 7 hozzáadás és 4 törlés
  1. 4 1
      include/fpmath.h
  2. 2 2
      src/math_private.h
  3. 1 1
      src/s_nan.c

+ 4 - 1
include/fpmath.h

@@ -55,6 +55,9 @@
 #define _BYTE_ORDER     BYTE_ORDER
 #endif
 
+#ifdef __FreeBSD__
+#include <machine/endian.h>
+#endif
 
 #ifdef WIN32
 #define _LITTLE_ENDIAN 1234
@@ -112,4 +115,4 @@ union IEEEd2bits {
 	} bits;
 };
 
-#endif
+#endif

+ 2 - 2
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

+ 1 - 1
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');