X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fmath.in.h;h=3ffb1774b455096df464d63bdb8ef3efa50b8bf3;hb=c2318e88599d84748f3537b54646913f0af0eb20;hp=f500824813247866904a9a003cdde31e02889390;hpb=c2a386bb5c38d93788eb1a099efce2e81a6ff8d7;p=gnulib.git diff --git a/lib/math.in.h b/lib/math.in.h index f50082481..3ffb1774b 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -17,6 +17,8 @@ #ifndef _GL_MATH_H +@PRAGMA_SYSTEM_HEADER@ + /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_MATH_H@ @@ -381,6 +383,57 @@ extern int gl_isfinitel (long double x); #endif +#if @GNULIB_ISINF@ +# if @REPLACE_ISINF@ +extern int gl_isinff (float x); +extern int gl_isinfd (double x); +extern int gl_isinfl (long double x); +# undef isinf +# define isinf(x) \ + (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \ + sizeof (x) == sizeof (double) ? gl_isinfd (x) : \ + gl_isinff (x)) +# endif +#elif defined GNULIB_POSIXCHECK + /* How to override a macro? */ +#endif + + +#if @GNULIB_ISNAN@ +# if @REPLACE_ISNAN@ +/* We can't just use the isnanf macro (e.g.) as exposed by + isnanf.h (e.g.) here, because those may end up being macros + that recursively expand back to isnan. So use the gnulib + replacements for them directly. */ +# if HAVE_ISNANF && __GNUC__ >= 4 +# define gl_isnan_f(x) __builtin_isnan ((float)(x)) +# else +extern int rpl_isnanf (float x); +# define gl_isnan_f(x) rpl_isnanf (x) +# endif +# if HAVE_ISNAND && __GNUC__ >= 4 +# define gl_isnan_d(x) __builtin_isnan ((double)(x)) +# else +extern int rpl_isnand (double x); +# define gl_isnan_d(x) rpl_isnand (x) +# endif +# if HAVE_ISNANL && __GNUC__ >= 4 +# define gl_isnan_l(x) __builtin_isnan ((long double)(x)) +# else +extern int rpl_isnanl (long double x); +# define gl_isnan_l(x) rpl_isnanl (x) +# endif +# undef isnan +# define isnan(x) \ + (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \ + sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \ + gl_isnan_f (x)) +# endif +#elif defined GNULIB_POSIXCHECK + /* How to override a macro? */ +#endif + + #if @GNULIB_SIGNBIT@ # if @REPLACE_SIGNBIT_USING_GCC@ # undef signbit