From 41c3db9f28afae381b1f4cb18ac370fcd3da8706 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 8 May 2018 14:05:04 +0100 Subject: [PATCH] PR libstdc++/85672 #undef _GLIBCXX_USE_FLOAT128 when not supported Restore the behaviour in GCC 8 and earlier where _GLIBCXX_USE_FLOAT128 is not defined when configure detects support is missing. This avoids having three states where the macro is either 1, 0, or undefined. PR libstdc++/85672 * include/Makefile.am [!ENABLE_FLOAT128]: Change c++config.h entry to #undef _GLIBCXX_USE_FLOAT128 instead of defining it to zero. * include/Makefile.in: Regenerate. * include/bits/c++config (_GLIBCXX_USE_FLOAT128): Move definition within conditional block. From-SVN: r260043 --- libstdc++-v3/ChangeLog | 9 +++++++++ libstdc++-v3/include/Makefile.am | 6 +++--- libstdc++-v3/include/Makefile.in | 6 +++--- libstdc++-v3/include/bits/c++config | 3 +-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 91df426c4f6..4f980ca21df 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2018-05-08 Jonathan Wakely + + PR libstdc++/85672 + * include/Makefile.am [!ENABLE_FLOAT128]: Change c++config.h entry + to #undef _GLIBCXX_USE_FLOAT128 instead of defining it to zero. + * include/Makefile.in: Regenerate. + * include/bits/c++config (_GLIBCXX_USE_FLOAT128): Move definition + within conditional block. + 2018-05-07 Jonathan Wakely * doc/xml/manual/using.xml (table.cmd_options): Document that the diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index ba5adda95bd..77e6dc2f6be 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -1232,10 +1232,10 @@ endif if ENABLE_FLOAT128 stamp-float128: - echo 1 > stamp-float128 + echo 'define _GLIBCXX_USE_FLOAT128 1' > stamp-float128 else stamp-float128: - echo 0 > stamp-float128 + echo 'undef _GLIBCXX_USE_FLOAT128' > stamp-float128 endif # NB: The non-empty default ldbl_compat works around an AIX sed @@ -1272,7 +1272,7 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \ -e "s,define _GLIBCXX_USE_DUAL_ABI, define _GLIBCXX_USE_DUAL_ABI $$dualabi," \ -e "s,define _GLIBCXX_USE_CXX11_ABI, define _GLIBCXX_USE_CXX11_ABI $$cxx11abi," \ -e "s,define _GLIBCXX_USE_ALLOCATOR_NEW, define _GLIBCXX_USE_ALLOCATOR_NEW $$allocatornew," \ - -e "s,define _GLIBCXX_USE_FLOAT128, define _GLIBCXX_USE_FLOAT128 $$float128," \ + -e "s,define _GLIBCXX_USE_FLOAT128,$$float128," \ -e "$$ldbl_compat" \ < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\ sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 41ccc7befe4..948a5c1f1c5 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -1663,9 +1663,9 @@ stamp-host: ${host_headers} ${bits_host_headers} ${ext_host_headers} ${host_head @ENABLE_ALLOCATOR_NEW_FALSE@ echo 0 > stamp-allocator-new @ENABLE_FLOAT128_TRUE@stamp-float128: -@ENABLE_FLOAT128_TRUE@ echo 1 > stamp-float128 +@ENABLE_FLOAT128_TRUE@ echo 'define _GLIBCXX_USE_FLOAT128 1' > stamp-float128 @ENABLE_FLOAT128_FALSE@stamp-float128: -@ENABLE_FLOAT128_FALSE@ echo 0 > stamp-float128 +@ENABLE_FLOAT128_FALSE@ echo 'undef _GLIBCXX_USE_FLOAT128' > stamp-float128 # NB: The non-empty default ldbl_compat works around an AIX sed # oddity, see libstdc++/31957 for details. @@ -1701,7 +1701,7 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \ -e "s,define _GLIBCXX_USE_DUAL_ABI, define _GLIBCXX_USE_DUAL_ABI $$dualabi," \ -e "s,define _GLIBCXX_USE_CXX11_ABI, define _GLIBCXX_USE_CXX11_ABI $$cxx11abi," \ -e "s,define _GLIBCXX_USE_ALLOCATOR_NEW, define _GLIBCXX_USE_ALLOCATOR_NEW $$allocatornew," \ - -e "s,define _GLIBCXX_USE_FLOAT128, define _GLIBCXX_USE_FLOAT128 $$float128," \ + -e "s,define _GLIBCXX_USE_FLOAT128,$$float128," \ -e "$$ldbl_compat" \ < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\ sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \ diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index e34524117d6..bfe268da825 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -610,9 +610,8 @@ namespace std #endif /* Define if __float128 is supported on this host. */ +#if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__) #define _GLIBCXX_USE_FLOAT128 -#if !defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__) -#undef _GLIBCXX_USE_FLOAT128 #endif // End of prewritten config; the settings discovered at configure time follow. -- 2.30.2