diff options
| author | martin <martin@NetBSD.org> | 2009-02-22 01:34:01 +0000 |
|---|---|---|
| committer | martin <martin@NetBSD.org> | 2009-02-22 01:34:01 +0000 |
| commit | c79c3eed1de26be7e12016b10eb7f9dec0a6430d (patch) | |
| tree | 935e139c80154932c51396a3a8d75d29b4f71680 /include/math.h | |
| parent | 07e886c39cfa522a1984bfa8efc240b819afe0fd (diff) | |
Make NAN a compile time constant (with help from the compiler). Suggested
by krister. Fixes PR 40695.
Make references to the old construct (which we can't remove for binary
compatibility reasons) emit a linker warning.
Diffstat (limited to 'include/math.h')
| -rw-r--r-- | include/math.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/math.h b/include/math.h index a4b64afbd6b..05973645494 100644 --- a/include/math.h +++ b/include/math.h @@ -1,4 +1,4 @@ -/* $NetBSD: math.h,v 1.47 2008/04/25 21:20:57 christos Exp $ */ +/* $NetBSD: math.h,v 1.48 2009/02/22 01:34:01 martin Exp $ */ /* * ==================================================== @@ -87,8 +87,12 @@ extern const union __long_double_u __infinityl; /* 7.12#5 NAN: a quiet NaN, if supported */ #ifdef __HAVE_NANF +#if __GNUC_PREREQ__(3,3) +#define NAN __builtin_nanf("") +#else extern const union __float_u __nanf; #define NAN __nanf.__val +#endif #endif /* __HAVE_NANF */ /* 7.12#6 number classification macros */ |
