]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Allow _GLIBCXX_HAVE_OBSOLETE_ISINF_ISNAN to be overridden
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Jan 2016 12:47:26 +0000 (12:47 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Jan 2016 12:47:26 +0000 (12:47 +0000)
PR libstdc++/69413
* config/os/gnu-linux/os_defines.h: Define
_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC.
* include/c_global/cmath (isinf, isnan): Check it.
* doc/xml/manual/internals.xml: Document it.
* doc/html/*: Regenerate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232726 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/config/os/gnu-linux/os_defines.h
libstdc++-v3/doc/html/manual/internals.html
libstdc++-v3/doc/xml/manual/internals.xml
libstdc++-v3/include/c_global/cmath

index 3b559c516ed2c34504e23b422a70044b10a8f09d..77ab6b31db105d1fb481a2251c5ce17605aee3c6 100644 (file)
@@ -1,3 +1,12 @@
+2016-01-22  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR libstdc++/69413
+       * config/os/gnu-linux/os_defines.h: Define
+       _GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC.
+       * include/c_global/cmath (isinf, isnan): Check it.
+       * doc/xml/manual/internals.xml: Document it.
+       * doc/html/*: Regenerate.
+
 2016-01-21  Jonathan Wakely  <jwakely@redhat.com>
 
        PR libstdc++/69406
index 30f32f391bd31c04fc8fe2c85819a076e7fff62f..59b0a622da60ae03ecc978099646490a1c6a29f6 100644 (file)
@@ -45,4 +45,8 @@
 # undef _GLIBCXX_HAVE_GETS
 #endif
 
+// Glibc 2.23 removed the obsolete isinf and isnan declarations. Check the
+// version dynamically in case it has changed since libstdc++ was configured.
+#define _GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC __GLIBC_PREREQ(2,23)
+
 #endif
index 559f8bb470a1e8ec61d50a30834835dfd3441970..4a521dbda488936f15075b1104ce64fd6e279c70 100644 (file)
@@ -88,6 +88,13 @@ the standard.
 to an expression that yields 0 if and only if the system headers
 are exposing proper support for the related set of functions.  If defined,
 it must be 0 while bootstrapping the compiler/rebuilding the library.
+   </p><p><code class="code">_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC</code> may be defined
+to an expression that yields 0 if and only if the system headers
+are exposing non-standard <code class="code">isinf(double)</code> and
+<code class="code">isnan(double)</code> functions in the global namespace. Those functions
+should be detected automatically by the <code class="code">configure</code> script when
+libstdc++ is built but if their presence depends on compilation flags or
+other macros the static configuration can be overridden.
    </p><p>Finally, you should bracket the entire file in an include-guard, like
 this:
    </p><pre class="programlisting">
index 7acec6bbf59db1b16fd27f03422f4fcf2371d73c..09407f86c24ed5aed95172cfb3cd8738e10256a7 100644 (file)
@@ -132,6 +132,14 @@ the standard.
 to an expression that yields 0 if and only if the system headers
 are exposing proper support for the related set of functions.  If defined,
 it must be 0 while bootstrapping the compiler/rebuilding the library.
+   </para>
+   <para><code>_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC</code> may be defined
+to an expression that yields 0 if and only if the system headers
+are exposing non-standard <code>isinf(double)</code> and
+<code>isnan(double)</code> functions in the global namespace. Those functions
+should be detected automatically by the <code>configure</code> script when
+libstdc++ is built but if their presence depends on compilation flags or
+other macros the static configuration can be overridden.
    </para>
    <para>Finally, you should bracket the entire file in an include-guard, like
 this:
index c4ee3f57fc373a065b96b20f08baf99b63f0c604..eca712e0549aefaa4bf76dbd01651d556c9ad83e 100644 (file)
@@ -610,7 +610,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   isinf(float __x)
   { return __builtin_isinf(__x); }
 
-#ifdef _GLIBCXX_HAVE_OBSOLETE_ISINF_ISNAN
+#if _GLIBCXX_HAVE_OBSOLETE_ISINF_ISNAN \
+  && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC
   using ::isinf;
 #else
   constexpr bool
@@ -634,7 +635,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   isnan(float __x)
   { return __builtin_isnan(__x); }
 
-#ifdef _GLIBCXX_HAVE_OBSOLETE_ISINF_ISNAN
+#if _GLIBCXX_HAVE_OBSOLETE_ISINF_ISNAN \
+  && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC
   using ::isnan;
 #else
   constexpr bool