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.
This commit is contained in:
Ed Schouten 2015-01-09 13:00:48 +01:00
parent f5377fda83
commit 17688c4487
14 changed files with 24 additions and 23 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

9
src/openlibm_fenv.h Normal file
View file

@ -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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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