mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Macroize inclusion of math-finite.h
This patch macroizes the declarations in math/bits/math-finite.h similarly to what math/bits/mathcalls.h does. For each floating-point type, the file is included once in math/math.h. This will reduce the amount of repetitive boilerplate required when adding float128 versions of these declarations. Tested for powerpc64le and s390x. * math/math.h: Include bits/math-finite.h once per floating-point type. * math/bits/math-finite.h: Macroize all declarations by floating-point type.
This commit is contained in:
42
math/math.h
42
math/math.h
@ -560,8 +560,48 @@ extern int matherr (struct exception *__exc);
|
||||
/* Define special entry points to use when the compiler got told to
|
||||
only expect finite results. */
|
||||
#if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0
|
||||
|
||||
/* Include bits/math-finite.h for double. */
|
||||
# define _Mdouble_ double
|
||||
# define __MATH_DECLARING_DOUBLE 1
|
||||
# define __MATH_DECLARING_LDOUBLE 0
|
||||
# define _MSUF_
|
||||
# include <bits/math-finite.h>
|
||||
#endif
|
||||
# undef _Mdouble_
|
||||
# undef __MATH_DECLARING_DOUBLE
|
||||
# undef __MATH_DECLARING_LDOUBLE
|
||||
# undef _MSUF_
|
||||
|
||||
/* When __USE_ISOC99 is defined, include math-finite for float and
|
||||
long double, as well. */
|
||||
# ifdef __USE_ISOC99
|
||||
|
||||
/* Include bits/math-finite.h for float. */
|
||||
# define _Mdouble_ float
|
||||
# define __MATH_DECLARING_DOUBLE 0
|
||||
# define __MATH_DECLARING_LDOUBLE 0
|
||||
# define _MSUF_ f
|
||||
# include <bits/math-finite.h>
|
||||
# undef _Mdouble_
|
||||
# undef __MATH_DECLARING_DOUBLE
|
||||
# undef __MATH_DECLARING_LDOUBLE
|
||||
# undef _MSUF_
|
||||
|
||||
/* Include bits/math-finite.h for long double. */
|
||||
# if __MATH_DECLARE_LDOUBLE
|
||||
# define _Mdouble_ long double
|
||||
# define __MATH_DECLARING_DOUBLE 0
|
||||
# define __MATH_DECLARING_LDOUBLE 1
|
||||
# define _MSUF_ l
|
||||
# include <bits/math-finite.h>
|
||||
# undef _Mdouble_
|
||||
# undef __MATH_DECLARING_DOUBLE
|
||||
# undef __MATH_DECLARING_LDOUBLE
|
||||
# undef _MSUF_
|
||||
# endif
|
||||
|
||||
# endif /* __USE_ISOC99. */
|
||||
#endif /* __FINITE_MATH_ONLY__ > 0. */
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* If we've still got undefined comparison macros, provide defaults. */
|
||||
|
Reference in New Issue
Block a user