diff options
author | das <das@FreeBSD.org> | 2011-10-10 15:43:09 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2011-10-10 15:43:09 +0000 |
commit | a38603b0b57960e07b576fdc7c8ed64d919770d0 (patch) | |
tree | a50d2b89f2f16772503039f06c8507b9292a1daa /lib/msun/mips/fenv.h | |
parent | 768c3db25c16c726fe7df21f139f54cd6342dfbf (diff) | |
download | FreeBSD-src-a38603b0b57960e07b576fdc7c8ed64d919770d0.zip FreeBSD-src-a38603b0b57960e07b576fdc7c8ed64d919770d0.tar.gz |
Provide external definitions of all of the standardized functions in
fenv.h that are currently inlined.
The definitions are provided in fenv.c via 'extern inline'
declaractions. This assumes the compiler handles 'extern inline' as
specified in C99, which has been true under FreeBSD since 8.0.
The goal is to eventually remove the 'static' keyword from the inline
definitions in fenv.h, so that non-inlined references all wind up
pointing to the same external definition like they're supposed to.
I am deferring the second step to provide a window where
newly-compiled apps will still link against old math libraries.
(This isn't supported, but there's no need to cause undue breakage.)
Reviewed by: stefanf, bde
Diffstat (limited to 'lib/msun/mips/fenv.h')
-rw-r--r-- | lib/msun/mips/fenv.h | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/lib/msun/mips/fenv.h b/lib/msun/mips/fenv.h index d540ae2..f114998 100644 --- a/lib/msun/mips/fenv.h +++ b/lib/msun/mips/fenv.h @@ -31,6 +31,10 @@ #include <sys/_types.h> +#ifndef __fenv_static +#define __fenv_static static +#endif + typedef __uint32_t fenv_t; typedef __uint32_t fexcept_t; @@ -68,7 +72,7 @@ extern const fenv_t __fe_dfl_env; #define __wfs(__fpsr) #endif -static __inline int +__fenv_static inline int feclearexcept(int __excepts) { fexcept_t __fpsr; @@ -79,7 +83,7 @@ feclearexcept(int __excepts) return (0); } -static __inline int +__fenv_static inline int fegetexceptflag(fexcept_t *__flagp, int __excepts) { fexcept_t __fpsr; @@ -89,7 +93,7 @@ fegetexceptflag(fexcept_t *__flagp, int __excepts) return (0); } -static __inline int +__fenv_static inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts) { fexcept_t __fpsr; @@ -101,7 +105,7 @@ fesetexceptflag(const fexcept_t *__flagp, int __excepts) return (0); } -static __inline int +__fenv_static inline int feraiseexcept(int __excepts) { fexcept_t __ex = __excepts; @@ -110,7 +114,7 @@ feraiseexcept(int __excepts) return (0); } -static __inline int +__fenv_static inline int fetestexcept(int __excepts) { fexcept_t __fpsr; @@ -119,7 +123,7 @@ fetestexcept(int __excepts) return (__fpsr & __excepts); } -static __inline int +__fenv_static inline int fegetround(void) { @@ -131,14 +135,14 @@ fegetround(void) return (-1); } -static __inline int +__fenv_static inline int fesetround(int __round) { return (-1); } -static __inline int +__fenv_static inline int fegetenv(fenv_t *__envp) { @@ -146,7 +150,7 @@ fegetenv(fenv_t *__envp) return (0); } -static __inline int +__fenv_static inline int feholdexcept(fenv_t *__envp) { fenv_t __env; @@ -158,7 +162,7 @@ feholdexcept(fenv_t *__envp) return (0); } -static __inline int +__fenv_static inline int fesetenv(const fenv_t *__envp) { @@ -166,7 +170,7 @@ fesetenv(const fenv_t *__envp) return (0); } -static __inline int +__fenv_static inline int feupdateenv(const fenv_t *__envp) { fexcept_t __fpsr; @@ -179,7 +183,9 @@ feupdateenv(const fenv_t *__envp) #if __BSD_VISIBLE -static __inline int +/* We currently provide no external definitions of the functions below. */ + +static inline int feenableexcept(int __mask) { fenv_t __old_fpsr, __new_fpsr; @@ -190,7 +196,7 @@ feenableexcept(int __mask) return ((__old_fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT); } -static __inline int +static inline int fedisableexcept(int __mask) { fenv_t __old_fpsr, __new_fpsr; @@ -201,7 +207,7 @@ fedisableexcept(int __mask) return ((__old_fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT); } -static __inline int +static inline int fegetexcept(void) { fenv_t __fpsr; |