PR libstdc++/85672 #undef _GLIBCXX_USE_FLOAT128 when not supported
authorJonathan Wakely <jwakely@redhat.com>
Tue, 8 May 2018 13:05:04 +0000 (14:05 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 8 May 2018 13:05:04 +0000 (14:05 +0100)
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
libstdc++-v3/include/Makefile.am
libstdc++-v3/include/Makefile.in
libstdc++-v3/include/bits/c++config

index 91df426c4f693bd8c1fb6a8a9b4185e1b79be944..4f980ca21dfe3870eb7daafebdb54e8dc1fa4e34 100644 (file)
@@ -1,3 +1,12 @@
+2018-05-08  Jonathan Wakely  <jwakely@redhat.com>
+
+       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  <jwakely@redhat.com>
 
        * doc/xml/manual/using.xml (table.cmd_options): Document that the
index ba5adda95bd07f9f631e92bdafa59d746894d4b9..77e6dc2f6be79ef1d78405b4e66416819145d9de 100644 (file)
@@ -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' \
index 41ccc7befe451c7fba87619c71a0efe5e70b4e7c..948a5c1f1c5442a8fd4a564a0d2f5803d287837a 100644 (file)
@@ -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' \
index e34524117d61ca2b554bf9fef83ea95f0df73f0b..bfe268da825090dec334224aafec0b9d646b9a7b 100644 (file)
@@ -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.