浏览代码

Rename include/fenv.h to <openlibm_fenv.h>.

OpenLibm has an implementation of fenv.h internally. This may be
problematic in case you want it to build against the host system's
implementation, as it would require you to somehow take the fenv.h file
out of the compiler search path.

Simply use a different naming scheme, similar to openlibm.h and
openlibm_complex.h. If we want to build against the host's fenv.h, we
can simply add an '#include <fenv.h>' from within this header.
Ed Schouten 10 年之前
父节点
当前提交
17688c4487
共有 14 个文件被更改,包括 24 次插入23 次删除
  1. 1 1
      amd64/fenv.c
  2. 4 2
      amd64/fenv.h
  3. 1 1
      arm/fenv.c
  4. 1 1
      i387/fenv.c
  5. 0 9
      include/fenv.h
  6. 1 1
      src/e_sqrtl.c
  7. 9 0
      src/openlibm_fenv.h
  8. 1 1
      src/s_fma.c
  9. 1 2
      src/s_fmaf.c
  10. 1 1
      src/s_fmal.c
  11. 1 1
      src/s_lrint.c
  12. 1 1
      src/s_lround.c
  13. 1 1
      src/s_nearbyint.c
  14. 1 1
      test/libm-test.c

+ 1 - 1
amd64/fenv.c

@@ -32,7 +32,7 @@
 #ifdef _WIN32
 #define __fenv_static
 #endif
-#include "fenv.h"
+#include "openlibm_fenv.h"
 
 #ifdef __GNUC_GNU_INLINE__
 #error "This file must be compiled with C99 'inline' semantics"

+ 4 - 2
amd64/fenv.h

@@ -29,8 +29,10 @@
 #ifndef	_FENV_H_
 #define	_FENV_H_
 
-#include "include/cdefs-compat.h"
-#include "include/types-compat.h"
+#include "cdefs-compat.h"
+#include "types-compat.h"
+
+#include "math_private.h"
 
 #ifndef	__fenv_static
 #define	__fenv_static	static

+ 1 - 1
arm/fenv.c

@@ -27,7 +27,7 @@
  */
 
 #define	__fenv_static
-#include "fenv.h"
+#include <openlibm_fenv.h>
 
 #ifdef __GNUC_GNU_INLINE__
 #error "This file must be compiled with C99 'inline' semantics"

+ 1 - 1
i387/fenv.c

@@ -32,7 +32,7 @@
 #include <i387/bsd_npx.h>
 
 #define	__fenv_static
-#include "fenv.h"
+#include <openlibm_fenv.h>
 
 #ifdef __GNUC_GNU_INLINE__
 #error "This file must be compiled with C99 'inline' semantics"

+ 0 - 9
include/fenv.h

@@ -1,9 +0,0 @@
-#ifdef __arm__
-#include "../arm/fenv.h"
-#else
-#ifdef __LP64
-#include "../amd64/fenv.h"
-#else
-#include "../i387/fenv.h"
-#endif
-#endif

+ 1 - 1
src/e_sqrtl.c

@@ -27,11 +27,11 @@
 #include "cdefs-compat.h"
 //__FBSDID("$FreeBSD: src/lib/msun/src/e_sqrtl.c,v 1.1 2008/03/02 01:47:58 das Exp $");
 
-#include <fenv.h>
 #include <float.h>
 
 #include "fpmath.h"
 #include "openlibm.h"
+#include "openlibm_fenv.h"
 #include "math_private.h"
 
 /* Return (x + ulp) for normal positive x. Assumes no overflow. */

+ 9 - 0
src/openlibm_fenv.h

@@ -0,0 +1,9 @@
+#if defined(__arm__)
+#include "../arm/fenv.h"
+#elif defined(__x86_64__)
+#include "../amd64/fenv.h"
+#elif defined(__i386__)
+#include "../i387/fenv.h"
+#else
+#error "Unsupported platform"
+#endif

+ 1 - 1
src/s_fma.c

@@ -27,9 +27,9 @@
 #include "cdefs-compat.h"
 //__FBSDID("$FreeBSD: src/lib/msun/src/s_fma.c,v 1.8 2011/10/21 06:30:43 das Exp $");
 
-#include <fenv.h>
 #include <float.h>
 #include <openlibm.h>
+#include <openlibm_fenv.h>
 
 #include "math_private.h"
 

+ 1 - 2
src/s_fmaf.c

@@ -27,9 +27,8 @@
 #include "cdefs-compat.h"
 //__FBSDID("$FreeBSD: src/lib/msun/src/s_fmaf.c,v 1.3 2011/10/15 04:16:58 das Exp $");
 
-#include <fenv.h>
-
 #include "openlibm.h"
+#include "openlibm_fenv.h"
 #include "math_private.h"
 
 /*

+ 1 - 1
src/s_fmal.c

@@ -27,9 +27,9 @@
 #include "cdefs-compat.h"
 //__FBSDID("$FreeBSD: src/lib/msun/src/s_fmal.c,v 1.7 2011/10/21 06:30:43 das Exp $");
 
-#include <fenv.h>
 #include <float.h>
 #include <openlibm.h>
+#include <openlibm_fenv.h>
 #include "math_private.h"
 #include "fpmath.h"
 

+ 1 - 1
src/s_lrint.c

@@ -25,8 +25,8 @@
  */
 
 #include "cdefs-compat.h"
-#include <fenv.h>
 #include <openlibm.h>
+#include <openlibm_fenv.h>
 #include "math_private.h"
 
 #ifndef type

+ 1 - 1
src/s_lround.c

@@ -29,8 +29,8 @@
 //#include <sys/limits.h>
 #include <limits.h>
 //VBS end
-#include <fenv.h>
 #include <openlibm.h>
+#include <openlibm_fenv.h>
 #include "math_private.h"
 
 #ifndef type

+ 1 - 1
src/s_nearbyint.c

@@ -27,8 +27,8 @@
 #include "cdefs-compat.h"
 //__FBSDID("$FreeBSD: src/lib/msun/src/s_nearbyint.c,v 1.2 2008/01/14 02:12:06 das Exp $");
 
-#include <fenv.h>
 #include <openlibm.h>
+#include <openlibm_fenv.h>
 #include "math_private.h"
 
 /*

+ 1 - 1
test/libm-test.c

@@ -123,8 +123,8 @@
 #include <fenv.h>
 #else
 #include "openlibm.h"
+#include "openlibm_fenv.h"
 #include "float.h"
-#include "fenv.h"
 #endif
 
 #if 0 /* XXX scp XXX */