Skip to content

Commit 17688c4

Browse files
committed
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.
1 parent f5377fd commit 17688c4

14 files changed

Lines changed: 24 additions & 23 deletions

File tree

amd64/fenv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#ifdef _WIN32
3333
#define __fenv_static
3434
#endif
35-
#include "fenv.h"
35+
#include "openlibm_fenv.h"
3636

3737
#ifdef __GNUC_GNU_INLINE__
3838
#error "This file must be compiled with C99 'inline' semantics"

amd64/fenv.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
#ifndef _FENV_H_
3030
#define _FENV_H_
3131

32-
#include "include/cdefs-compat.h"
33-
#include "include/types-compat.h"
32+
#include "cdefs-compat.h"
33+
#include "types-compat.h"
34+
35+
#include "math_private.h"
3436

3537
#ifndef __fenv_static
3638
#define __fenv_static static

arm/fenv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828

2929
#define __fenv_static
30-
#include "fenv.h"
30+
#include <openlibm_fenv.h>
3131

3232
#ifdef __GNUC_GNU_INLINE__
3333
#error "This file must be compiled with C99 'inline' semantics"

i387/fenv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <i387/bsd_npx.h>
3333

3434
#define __fenv_static
35-
#include "fenv.h"
35+
#include <openlibm_fenv.h>
3636

3737
#ifdef __GNUC_GNU_INLINE__
3838
#error "This file must be compiled with C99 'inline' semantics"

include/fenv.h

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/e_sqrtl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
#include "cdefs-compat.h"
2828
//__FBSDID("$FreeBSD: src/lib/msun/src/e_sqrtl.c,v 1.1 2008/03/02 01:47:58 das Exp $");
2929

30-
#include <fenv.h>
3130
#include <float.h>
3231

3332
#include "fpmath.h"
3433
#include "openlibm.h"
34+
#include "openlibm_fenv.h"
3535
#include "math_private.h"
3636

3737
/* Return (x + ulp) for normal positive x. Assumes no overflow. */

src/openlibm_fenv.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#if defined(__arm__)
2+
#include "../arm/fenv.h"
3+
#elif defined(__x86_64__)
4+
#include "../amd64/fenv.h"
5+
#elif defined(__i386__)
6+
#include "../i387/fenv.h"
7+
#else
8+
#error "Unsupported platform"
9+
#endif

src/s_fma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
#include "cdefs-compat.h"
2828
//__FBSDID("$FreeBSD: src/lib/msun/src/s_fma.c,v 1.8 2011/10/21 06:30:43 das Exp $");
2929

30-
#include <fenv.h>
3130
#include <float.h>
3231
#include <openlibm.h>
32+
#include <openlibm_fenv.h>
3333

3434
#include "math_private.h"
3535

src/s_fmaf.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@
2727
#include "cdefs-compat.h"
2828
//__FBSDID("$FreeBSD: src/lib/msun/src/s_fmaf.c,v 1.3 2011/10/15 04:16:58 das Exp $");
2929

30-
#include <fenv.h>
31-
3230
#include "openlibm.h"
31+
#include "openlibm_fenv.h"
3332
#include "math_private.h"
3433

3534
/*

src/s_fmal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
#include "cdefs-compat.h"
2828
//__FBSDID("$FreeBSD: src/lib/msun/src/s_fmal.c,v 1.7 2011/10/21 06:30:43 das Exp $");
2929

30-
#include <fenv.h>
3130
#include <float.h>
3231
#include <openlibm.h>
32+
#include <openlibm_fenv.h>
3333
#include "math_private.h"
3434
#include "fpmath.h"
3535

0 commit comments

Comments
 (0)