This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Remove _Mlong_double_ etc. macros [committed]
- From: Joseph Myers <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Mon, 30 Oct 2017 20:59:33 +0000
- Subject: Remove _Mlong_double_ etc. macros [committed]
- Authentication-results: sourceware.org; auth=none
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. Committed.
2017-10-30 Joseph Myers <joseph@codesourcery.com>
* 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.
diff --git a/include/math.h b/include/math.h
index fe3ed13..7ee291f 100644
--- a/include/math.h
+++ b/include/math.h
@@ -2,7 +2,6 @@
#ifdef _ISOMAC
# undef NO_LONG_DOUBLE
-# undef _Mlong_double_
#endif
#include <math/math.h>
diff --git a/math/Makefile b/math/Makefile
index 1feb425..b2bd3d3 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -561,10 +561,8 @@ math-CPPFLAGS += -D__NO_MATH_INLINES -D__LIBC_INTERNAL_MATH_INLINES
ifneq ($(long-double-fcts),yes)
# The `double' and `long double' types are the same on this machine.
# We won't compile the `long double' code at all. Tell the `double' code
-# to define aliases for the `FUNCl' names. To avoid type conflicts in
-# defining those aliases, tell <math.h> to declare the `FUNCl' names with
-# `double' instead of `long double'.
-math-CPPFLAGS += -DNO_LONG_DOUBLE -D_Mlong_double_=double
+# to define aliases for the `FUNCl' names.
+math-CPPFLAGS += -DNO_LONG_DOUBLE
endif
# These files quiet sNaNs in a way that is optimized away without
diff --git a/math/complex.h b/math/complex.h
index 1ae4ec2..9a6cc3e 100644
--- a/math/complex.h
+++ b/math/complex.h
@@ -83,10 +83,7 @@ __BEGIN_DECLS
#undef __MATH_PRECNAME
/* Now the float versions. */
-#ifndef _Mfloat_
-# define _Mfloat_ float
-#endif
-#define _Mdouble_ _Mfloat_
+#define _Mdouble_ float
#define __MATH_PRECNAME(name) name##f
#include <bits/cmathcalls.h>
#undef _Mdouble_
@@ -94,15 +91,12 @@ __BEGIN_DECLS
#if (__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)) \
&& __GLIBC_USE (IEC_60559_TYPES_EXT)
-# ifndef _Mfloat128_
-# define _Mfloat128_ _Float128
-# endif
/* GCC < 7 requires extra convincing to expose a complex float128 type. */
# ifdef __CFLOAT128
# undef _Mdouble_complex_
# define _Mdouble_complex_ __CFLOAT128
# endif
-# define _Mdouble_ _Mfloat128_
+# define _Mdouble_ _Float128
# define __MATH_PRECNAME(name) name##f128
# include <bits/cmathcalls.h>
# undef _Mdouble_
@@ -120,10 +114,7 @@ __BEGIN_DECLS
extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function)
# endif
-# ifndef _Mlong_double_
-# define _Mlong_double_ long double
-# endif
-# define _Mdouble_ _Mlong_double_
+# define _Mdouble_ long double
# define __MATH_PRECNAME(name) name##l
# include <bits/cmathcalls.h>
#endif
diff --git a/math/math.h b/math/math.h
index 5683ac9..88fd4bc 100644
--- a/math/math.h
+++ b/math/math.h
@@ -299,10 +299,7 @@ enum
/* Include the file of declarations again, this time using `float'
instead of `double' and appending f to each function name. */
-# ifndef _Mfloat_
-# define _Mfloat_ float
-# endif
-# define _Mdouble_ _Mfloat_
+# define _Mdouble_ float
# define __MATH_PRECNAME(name,r) name##f##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 0
@@ -344,10 +341,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
/* Include the file of declarations again, this time using `long double'
instead of `double' and appending l to each function name. */
-# ifndef _Mlong_double_
-# define _Mlong_double_ long double
-# endif
-# define _Mdouble_ _Mlong_double_
+# define _Mdouble_ long double
# define __MATH_PRECNAME(name,r) name##l##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 0
@@ -367,10 +361,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
types. */
#if __HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !defined _LIBC)
-# ifndef _Mfloat16_
-# define _Mfloat16_ _Float16
-# endif
-# define _Mdouble_ _Mfloat16_
+# define _Mdouble_ _Float16
# define __MATH_PRECNAME(name,r) name##f16##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
@@ -387,10 +378,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
#endif /* __HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC). */
#if __HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !defined _LIBC)
-# ifndef _Mfloat32_
-# define _Mfloat32_ _Float32
-# endif
-# define _Mdouble_ _Mfloat32_
+# define _Mdouble_ _Float32
# define __MATH_PRECNAME(name,r) name##f32##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
@@ -407,10 +395,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
#endif /* __HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC). */
#if __HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !defined _LIBC)
-# ifndef _Mfloat64_
-# define _Mfloat64_ _Float64
-# endif
-# define _Mdouble_ _Mfloat64_
+# define _Mdouble_ _Float64
# define __MATH_PRECNAME(name,r) name##f64##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
@@ -427,10 +412,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
#endif /* __HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC). */
#if __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)
-# ifndef _Mfloat128_
-# define _Mfloat128_ _Float128
-# endif
-# define _Mdouble_ _Mfloat128_
+# define _Mdouble_ _Float128
# define __MATH_PRECNAME(name,r) name##f128##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
@@ -447,10 +429,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
#endif /* __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !_LIBC). */
#if __HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !defined _LIBC)
-# ifndef _Mfloat32x_
-# define _Mfloat32x_ _Float32x
-# endif
-# define _Mdouble_ _Mfloat32x_
+# define _Mdouble_ _Float32x
# define __MATH_PRECNAME(name,r) name##f32x##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
@@ -467,10 +446,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
#endif /* __HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC). */
#if __HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !defined _LIBC)
-# ifndef _Mfloat64x_
-# define _Mfloat64x_ _Float64x
-# endif
-# define _Mdouble_ _Mfloat64x_
+# define _Mdouble_ _Float64x
# define __MATH_PRECNAME(name,r) name##f64x##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
@@ -487,10 +463,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
#endif /* __HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC). */
#if __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !defined _LIBC)
-# ifndef _Mfloat128x_
-# define _Mfloat128x_ _Float128x
-# endif
-# define _Mdouble_ _Mfloat128x_
+# define _Mdouble_ _Float128x
# define __MATH_PRECNAME(name,r) name##f128x##r
# define __MATH_DECLARING_DOUBLE 0
# define __MATH_DECLARING_FLOATN 1
diff --git a/math/test-signgam-finite-c99.c b/math/test-signgam-finite-c99.c
index 07fdcda..cfe9df0 100644
--- a/math/test-signgam-finite-c99.c
+++ b/math/test-signgam-finite-c99.c
@@ -19,7 +19,6 @@
#undef _LIBC
#undef __LIBC_INTERNAL_MATH_INLINES
#undef _GNU_SOURCE
-#undef _Mlong_double_
#include <math.h>
#include <stdio.h>
--
Joseph S. Myers
joseph@codesourcery.com