From a0ebeb988d63d94da086b72daf0691f67584724a Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 22 Dec 2008 11:31:12 +0000 Subject: - fix fpclassify, signbit, isfinite, isnan, isinf macros for long double math support - add rule to create preprocessor output for float- and long double math wrapper --- include/math.h | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/math.h b/include/math.h index ae5d6ec70..15bc9ccc6 100644 --- a/include/math.h +++ b/include/math.h @@ -46,6 +46,10 @@ __BEGIN_DECLS /* Get general and ISO C99 specific information. */ #include +#if !(defined _LIBC && (defined NOT_IN_libc && defined IS_IN_libm)) +# define libm_hidden_proto(name, attrs...) +#endif + /* The file contains the prototypes for all the actual math functions. These macros are used for those prototypes, so we can easily declare each function as both `name' and `__name', @@ -55,15 +59,32 @@ __BEGIN_DECLS __MATHDECL (_Mdouble_,function,suffix, args) #define __MATHDECL(type, function,suffix, args) \ __MATHDECL_1(type, function,suffix, args); \ - __MATHDECL_1(type, __CONCAT(__,function),suffix, args) + #define __MATHCALLX(function,suffix, args, attrib) \ __MATHDECLX (_Mdouble_,function,suffix, args, attrib) #define __MATHDECLX(type, function,suffix, args, attrib) \ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ - __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib) + __MATHDECLI_MAINVARIANT(function) + + #define __MATHDECL_1(type, function,suffix, args) \ extern type __MATH_PRECNAME(function,suffix) args __THROW - +/* Decls which are also used internally in libm. + Only the main variant is used internally, no need to try to avoid relocs + for the {l,f} variants. */ +#define __MATHCALLI(function,suffix, args) \ + __MATHDECLI (_Mdouble_,function,suffix, args) +#define __MATHDECLI(type, function,suffix, args) \ + __MATHDECL_1(type, function,suffix, args); \ + __MATHDECLI_MAINVARIANT(function) +/* Private helpers for purely macro impls below. + Only make __foo{,f,l} visible but not (the macro-only) foo. */ +#define __MATHDECL_PRIV(type, function,suffix, args, attrib) \ + __MATHDECL_1(type, __CONCAT(__,function),suffix, args) \ + __attribute__ (attrib); \ + libm_hidden_proto(__MATH_PRECNAME(__##function,suffix)) + +#define __MATHDECLI_MAINVARIANT libm_hidden_proto #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) # define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD @@ -72,7 +93,9 @@ __BEGIN_DECLS #undef _Mdouble_ #undef _Mdouble_BEGIN_NAMESPACE #undef _Mdouble_END_NAMESPACE -#undef __MATH_PRECNAME +#undef __MATH_PRECNAME +#undef __MATHDECLI_MAINVARIANT +#define __MATHDECLI_MAINVARIANT(x) #if defined __USE_MISC || defined __USE_ISOC99 -- cgit v1.2.3