From 251b961d0fab0c655f732d2034771f75fa63a409 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 6 Oct 2011 10:56:19 +0200 Subject: [PATCH] math: Sort function declarations of math.in.h. * lib/math.in.h (frexp, logb): Move declarations. --- ChangeLog | 5 ++++ lib/math.in.h | 81 +++++++++++++++++++++++++++++++---------------------------- 2 files changed, 47 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 25753ac1c..6dd6ac821 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-10-06 Bruno Haible + + math: Sort function declarations of math.in.h. + * lib/math.in.h (frexp, logb): Move declarations. + 2011-10-05 Bruno Haible Tests for module 'modff'. diff --git a/lib/math.in.h b/lib/math.in.h index 435d79c1a..80bc78c98 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -108,45 +108,6 @@ _NaN () #endif -/* Write x as - x = mantissa * 2^exp - where - If x finite and nonzero: 0.5 <= |mantissa| < 1.0. - If x is zero: mantissa = x, exp = 0. - If x is infinite or NaN: mantissa = x, exp unspecified. - Store exp in *EXPPTR and return mantissa. */ -#if @GNULIB_FREXP@ -# if @REPLACE_FREXP@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# define frexp rpl_frexp -# endif -_GL_FUNCDECL_RPL (frexp, double, (double x, int *expptr) _GL_ARG_NONNULL ((2))); -_GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr)); -# else -_GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr)); -# endif -_GL_CXXALIASWARN (frexp); -#elif defined GNULIB_POSIXCHECK -# undef frexp -/* Assume frexp is always declared. */ -_GL_WARN_ON_USE (frexp, "frexp is unportable - " - "use gnulib module frexp for portability"); -#endif - - -#if @GNULIB_LOGB@ -# if !@HAVE_DECL_LOGB@ -_GL_EXTERN_C double logb (double x); -# endif -#elif defined GNULIB_POSIXCHECK -# undef logb -# if HAVE_RAW_DECL_LOGB -_GL_WARN_ON_USE (logb, "logb is unportable - " - "use gnulib module logb for portability"); -# endif -#endif - - #if @GNULIB_ACOSL@ # if !@HAVE_ACOSL@ || !@HAVE_DECL_ACOSL@ _GL_FUNCDECL_SYS (acosl, long double, (long double x)); @@ -381,6 +342,31 @@ _GL_WARN_ON_USE (fmodf, "fmodf is unportable - " If x is zero: mantissa = x, exp = 0. If x is infinite or NaN: mantissa = x, exp unspecified. Store exp in *EXPPTR and return mantissa. */ +#if @GNULIB_FREXP@ +# if @REPLACE_FREXP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define frexp rpl_frexp +# endif +_GL_FUNCDECL_RPL (frexp, double, (double x, int *expptr) _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr)); +# else +_GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr)); +# endif +_GL_CXXALIASWARN (frexp); +#elif defined GNULIB_POSIXCHECK +# undef frexp +/* Assume frexp is always declared. */ +_GL_WARN_ON_USE (frexp, "frexp is unportable - " + "use gnulib module frexp for portability"); +#endif + +/* Write x as + x = mantissa * 2^exp + where + If x finite and nonzero: 0.5 <= |mantissa| < 1.0. + If x is zero: mantissa = x, exp = 0. + If x is infinite or NaN: mantissa = x, exp unspecified. + Store exp in *EXPPTR and return mantissa. */ #if @GNULIB_FREXPL@ && @REPLACE_FREXPL@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef frexpl @@ -438,6 +424,19 @@ _GL_WARN_ON_USE (ldexpl, "ldexpl is unportable - " #endif +#if @GNULIB_LOGB@ +# if !@HAVE_DECL_LOGB@ +_GL_EXTERN_C double logb (double x); +# endif +#elif defined GNULIB_POSIXCHECK +# undef logb +# if HAVE_RAW_DECL_LOGB +_GL_WARN_ON_USE (logb, "logb is unportable - " + "use gnulib module logb for portability"); +# endif +#endif + + #if @GNULIB_LOGL@ # if !@HAVE_LOGL@ || !@HAVE_DECL_LOGL@ _GL_FUNCDECL_SYS (logl, long double, (long double x)); @@ -652,6 +651,10 @@ _GL_WARN_ON_USE (truncl, "truncl is unportable - " #endif +/* Definitions of function-like macros come here, after the function + declarations. */ + + #if @GNULIB_ISFINITE@ # if @REPLACE_ISFINITE@ _GL_EXTERN_C int gl_isfinitef (float x); -- 2.11.0