mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
eda162dd8a
math.h has a macro _Mlong_double_ for the type to use when declaring long double functions, and similar macros for other types. math/Makefile uses -D_Mlong_double_=double in the case of long double having the same ABI as double. This originates with: Mon Jul 8 13:37:40 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * math/math.h (_Mfloat_, _Mlong_double_): New macros, defined iff not already defined to float, long double. Use those macros for _Mdouble_ defns when including mathcalls.h. * math/Makefile [$(long-double-fcts) != yes] (CPPFLAGS): Append -D_Mlong_double_=double. However, math.h stopped declaring long double functions in the case of long double having the same ABI as double (and thus probably stopped actually needing the Makefile definition of _Mlong_double_) with: 1998-11-05 Ulrich Drepper <drepper@cygnus.com> * math/math.h: Unconditionally include bits/mathdef.h. Declare long double functions only if __NO_LONG_DOUBLE_MATH is not defined. * sysdeps/generic/bits/mathdef.h: Define only if __USE_ISOC9X. Define __NO_LONG_DOUBLE_MATH. * sysdeps/m68k/fpu/bits/mathdef.h: Define only if __USE_ISOC9X. * sysdeps/i386/fpu/bits/mathdef.h: Likewise. The declarations were since restored for compiling user code, but remain absent when _LIBC is defined, which is sufficient to avoid problems declaring function aliases of incompatible types. Thus the indirection through the _Mlong_double_ macro is not needed (probably since that 1998 patch), and this patch removes _Mlong_double_ and associated macros for other types, leaving only the macro _Mdouble_ which is actually used as the type for which a given inclusion of <bits/mathcalls.h> should declared functions. Tested for x86_64, and tested with build-many-glibcs.py that installed stripped shared libraries are unchanged by this patch. * math/math.h [!_Mfloat_] (_Mfloat_): Do not define. [!_Mlong_double_] (_Mlong_double_): Likewise. [!_Mfloat16_] (_Mfloat16_): Likewise. [!_Mfloat32_] (_Mfloat32_): Likewise. [!_Mfloat64_] (_Mfloat64_): Likewise. [!_Mfloat128_] (_Mfloat128_): Likewise. [!_Mfloat32x_] (_Mfloat32x_): Likewise. [!_Mfloat64x_] (_Mfloat64x_): Likewise. [!_Mfloat128x_] (_Mfloat128x_): Likewise. (_Mdouble_): Define without indirection through those macros. * math/complex.h [!_Mfloat_] (_Mfloat_): Do not define. [!_Mfloat128_] (_Mfloat128_): Likewise. [_Mlong_double_] (_Mlong_double_): Likewise. (_Mdouble_): Define without indirection through those macros. * math/Makefile [$(long-double-fcts) != yes] (math-CPPFLAGS): Do not add -D_Mlong_double_=double. * include/math.h [_ISOMAC] (_Mlong_double_): Do not undefine. * math/test-signgam-finite-c99.c (_Mlong_double_): Likewise.
59 lines
1.2 KiB
C
59 lines
1.2 KiB
C
#ifndef _MATH_H
|
|
|
|
#ifdef _ISOMAC
|
|
# undef NO_LONG_DOUBLE
|
|
#endif
|
|
|
|
#include <math/math.h>
|
|
|
|
#ifndef _ISOMAC
|
|
/* Now define the internal interfaces. */
|
|
extern int __signgam;
|
|
|
|
# if IS_IN (libc) || IS_IN (libm)
|
|
hidden_proto (__finite)
|
|
hidden_proto (__isinf)
|
|
hidden_proto (__isnan)
|
|
hidden_proto (__finitef)
|
|
hidden_proto (__isinff)
|
|
hidden_proto (__isnanf)
|
|
|
|
# ifndef __NO_LONG_DOUBLE_MATH
|
|
hidden_proto (__finitel)
|
|
hidden_proto (__isinfl)
|
|
hidden_proto (__isnanl)
|
|
# endif
|
|
|
|
# if __HAVE_DISTINCT_FLOAT128
|
|
hidden_proto (__finitef128)
|
|
hidden_proto (__isinff128)
|
|
hidden_proto (__isnanf128)
|
|
hidden_proto (__signbitf128)
|
|
# endif
|
|
# endif
|
|
|
|
libm_hidden_proto (__fpclassify)
|
|
libm_hidden_proto (__fpclassifyf)
|
|
libm_hidden_proto (__issignaling)
|
|
libm_hidden_proto (__issignalingf)
|
|
libm_hidden_proto (__exp)
|
|
libm_hidden_proto (__expf)
|
|
libm_hidden_proto (__roundeven)
|
|
|
|
# ifndef __NO_LONG_DOUBLE_MATH
|
|
libm_hidden_proto (__fpclassifyl)
|
|
libm_hidden_proto (__issignalingl)
|
|
libm_hidden_proto (__expl)
|
|
libm_hidden_proto (__expm1l)
|
|
# endif
|
|
|
|
# if __HAVE_DISTINCT_FLOAT128
|
|
libm_hidden_proto (__fpclassifyf128)
|
|
libm_hidden_proto (__issignalingf128)
|
|
libm_hidden_proto (__expf128)
|
|
libm_hidden_proto (__expm1f128)
|
|
# endif
|
|
|
|
#endif
|
|
#endif
|