1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

Support __STDC_WANT_IEC_60559_FUNCS_EXT__ feature test macro.

This patch implements support for the
__STDC_WANT_IEC_60559_FUNCS_EXT__ feature test macro, following the
__GLIBC_USE approach used for other ISO C feature test macros.
Currently this only affects the exp10 functions (which glibc has had
for a long time).

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	* bits/libc-header-start.h (__GLIBC_USE_IEC_60559_FUNCS_EXT): New
	macro.
	* include/features.h (__STDC_WANT_IEC_60559_FUNCS_EXT__):
	Document.
	* manual/creature.texi (__STDC_WANT_IEC_60559_FUNCS_EXT__):
	Document macro.
	* manual/math.texi (exp10): Document as ISO from TS 18661-4:2015.
	(exp10f): Likewise.
	(exp10l): Likewise.
	* math/bits/mathcalls.h (exp10): Declare if
	[__GLIBC_USE (IEC_60559_FUNCS_EXT)], not [__USE_GNU].
This commit is contained in:
Joseph Myers
2016-08-03 22:21:37 +00:00
parent 71b4804447
commit 412cb261b0
7 changed files with 46 additions and 6 deletions

View File

@ -1,5 +1,17 @@
2016-08-03 Joseph Myers <joseph@codesourcery.com> 2016-08-03 Joseph Myers <joseph@codesourcery.com>
* bits/libc-header-start.h (__GLIBC_USE_IEC_60559_FUNCS_EXT): New
macro.
* include/features.h (__STDC_WANT_IEC_60559_FUNCS_EXT__):
Document.
* manual/creature.texi (__STDC_WANT_IEC_60559_FUNCS_EXT__):
Document macro.
* manual/math.texi (exp10): Document as ISO from TS 18661-4:2015.
(exp10f): Likewise.
(exp10l): Likewise.
* math/bits/mathcalls.h (exp10): Declare if
[__GLIBC_USE (IEC_60559_FUNCS_EXT)], not [__USE_GNU].
* manual/arith.texi (nextup): Fix typo in last change. * manual/arith.texi (nextup): Fix typo in last change.
2016-08-03 Zack Weinberg <zackw@panix.com> 2016-08-03 Zack Weinberg <zackw@panix.com>

5
NEWS
View File

@ -17,6 +17,11 @@ Version 2.25
from that TS. Note that most features from that TS are not supported by from that TS. Note that most features from that TS are not supported by
the GNU C Library. the GNU C Library.
* The feature test macro __STDC_WANT_IEC_60559_FUNCS_EXT__, from ISO/IEC TS
18661-4:2015, is supported to enable declarations of functions and macros
from that TS. Note that most features from that TS are not supported by
the GNU C Library.
* The inclusion of <sys/sysmacros.h> by <sys/types.h> is deprecated. This * The inclusion of <sys/sysmacros.h> by <sys/types.h> is deprecated. This
means that in a future release, the macros “major”, “minor”, and “makedev” means that in a future release, the macros “major”, “minor”, and “makedev”
will only be available from <sys/sysmacros.h>. will only be available from <sys/sysmacros.h>.

View File

@ -50,3 +50,12 @@
#else #else
# define __GLIBC_USE_IEC_60559_BFP_EXT 0 # define __GLIBC_USE_IEC_60559_BFP_EXT 0
#endif #endif
/* ISO/IEC TS 18661-4:2015 defines the
__STDC_WANT_IEC_60559_FUNCS_EXT__ macro. */
#undef __GLIBC_USE_IEC_60559_FUNCS_EXT
#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__
# define __GLIBC_USE_IEC_60559_FUNCS_EXT 1
#else
# define __GLIBC_USE_IEC_60559_FUNCS_EXT 0
#endif

View File

@ -26,6 +26,8 @@
_ISOC11_SOURCE Extensions to ISO C99 from ISO C11. _ISOC11_SOURCE Extensions to ISO C99 from ISO C11.
__STDC_WANT_LIB_EXT2__ Extensions to ISO C99 from TR 27431-2:2010. __STDC_WANT_LIB_EXT2__ Extensions to ISO C99 from TR 27431-2:2010.
__STDC_WANT_IEC_60559_BFP_EXT__ Extensions to ISO C11 from TS 18661-1:2014. __STDC_WANT_IEC_60559_BFP_EXT__ Extensions to ISO C11 from TS 18661-1:2014.
__STDC_WANT_IEC_60559_FUNCS_EXT__ Extensions to ISO C11 from
TS 18661-4:2015.
_POSIX_SOURCE IEEE Std 1003.1. _POSIX_SOURCE IEEE Std 1003.1.
_POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
if >=199309L, add IEEE Std 1003.1b-1993; if >=199309L, add IEEE Std 1003.1b-1993;

View File

@ -182,6 +182,15 @@ are enabled. Only some of the features from this TS are supported by
@theglibc{}. @theglibc{}.
@end defvr @end defvr
@comment (none)
@comment ISO
@defvr Macro __STDC_WANT_IEC_60559_FUNCS_EXT__
If you define this macro, features from ISO/IEC TS 18661-4:2015
(Floating-point extensions for C: Supplementary functions) are
enabled. Only some of the features from this TS are supported by
@theglibc{}.
@end defvr
@comment (none) @comment (none)
@comment GNU @comment GNU
@defvr Macro _GNU_SOURCE @defvr Macro _GNU_SOURCE

View File

@ -480,13 +480,13 @@ Mathematically, @code{exp2 (x)} is the same as @code{exp (x * log (2))}.
@end deftypefun @end deftypefun
@comment math.h @comment math.h
@comment GNU @comment ISO
@deftypefun double exp10 (double @var{x}) @deftypefun double exp10 (double @var{x})
@comment math.h @comment math.h
@comment GNU @comment ISO
@deftypefunx float exp10f (float @var{x}) @deftypefunx float exp10f (float @var{x})
@comment math.h @comment math.h
@comment GNU @comment ISO
@deftypefunx {long double} exp10l (long double @var{x}) @deftypefunx {long double} exp10l (long double @var{x})
@comment math.h @comment math.h
@comment GNU @comment GNU
@ -501,7 +501,8 @@ Mathematically, @code{exp2 (x)} is the same as @code{exp (x * log (2))}.
These functions compute @code{10} raised to the power @var{x}. These functions compute @code{10} raised to the power @var{x}.
Mathematically, @code{exp10 (x)} is the same as @code{exp (x * log (10))}. Mathematically, @code{exp10 (x)} is the same as @code{exp (x * log (10))}.
These functions are GNU extensions. The name @code{exp10} is The @code{exp10} functions are from TS 18661-4:2015; the @code{pow10}
names are GNU extensions. The name @code{exp10} is
preferred, since it is analogous to @code{exp} and @code{exp2}. preferred, since it is analogous to @code{exp} and @code{exp2}.
@end deftypefun @end deftypefun

View File

@ -115,9 +115,11 @@ __MATHCALL (log10,, (_Mdouble_ __x));
__MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2)); __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2));
_Mdouble_END_NAMESPACE _Mdouble_END_NAMESPACE
#ifdef __USE_GNU #if __GLIBC_USE (IEC_60559_FUNCS_EXT)
/* A function missing in all standards: compute exponent to base ten. */ /* Compute exponent to base ten. */
__MATHCALL (exp10,, (_Mdouble_ __x)); __MATHCALL (exp10,, (_Mdouble_ __x));
#endif
#ifdef __USE_GNU
/* Another name occasionally used. */ /* Another name occasionally used. */
__MATHCALL (pow10,, (_Mdouble_ __x)); __MATHCALL (pow10,, (_Mdouble_ __x));
#endif #endif