]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
More fine-grained autoconf checks for C99 library
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Nov 2015 14:51:25 +0000 (14:51 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Nov 2015 14:51:25 +0000 (14:51 +0000)
2015-11-13  Jennifer Yao  <jenny.hyphen.fa@gmail.com>
    Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/58393
PR libstdc++/61580
* acinclude.m4 (GLIBCXX_ENABLE_C99): Perform tests twice, with
-std=c++11 as well as -std=c++98, and define separate macros for each.
Cache the results of checking for complex math and wide character
functions. Reformat for readability.
* config.h.in: Regenerate.
* include/bits/c++config: Define _GLIBCXX_USE_C99_XXX macros to
either _GLIBCXX98_USE_C99_XXX or _GLIBCXX11_USE_C99_XXX according to
language standard in use.
* config/locale/dragonfly/c_locale.h (std::__convert_from_v): Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* config/locale/generic/c_locale.h (std::__convert_from_v): Likewise.
* config/locale/gnu/c_locale.h (std::__convert_from_v): Likewise.
* config/os/bsd/dragonfly/os_defines.h: Define _GLIBCXX_USE_C99_STDIO,
_GLIBCXX_USE_C99_STDLIB, and _GLIBCXX_USE_C99_WCHAR.
* configure: Regenerate.
* include/bits/basic_string.h: Make numeric conversion functions
depend on _GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, or
_GLIBCXX_USE_C99_WCHAR, instead of _GLIBCXX_USE_C99.
* include/ext/vstring.h: Likewise.
* include/bits/locale_facets.tcc (std::num_put::_M_insert_float):
Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* include/bits/locale_facets_nonio.tcc (std::money_put::do_put):
Likewise.
* include/c_compatibility/math.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_MATH.
* include/c_compatibility/wchar.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/c_global/cstdio: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
* include/c_global/cstdlib: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* include/c_global/cwchar: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/c_std/cstdio: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
* include/c_std/cstdlib: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* include/c_std/cwchar: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/tr1/cstdio: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.
* include/tr1/cstdlib: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* include/tr1/cwchar: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_WCHAR.
* include/tr1/stdlib.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDLIB.
* src/c++98/locale_facets.cc (std::__num_base::_S_format_float):
Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* testsuite/18_support/exception_ptr/60612-terminate.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
* testsuite/18_support/exception_ptr/60612-unexpected.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc
(test01): Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stof.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoi.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stol.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stold.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoll.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoul.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
stoull.cc: Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
to_wstring.cc: Likewise.
* testsuite/26_numerics/headers/cstdlib/13943.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
* testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc: Likewise.
* testsuite/lib/libstdc++.exp (check_v3_target_string_conversions):
Change preprocessor #if conditional so that it uses
_GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, and
_GLIBCXX_USE_C99_WCHAR, instead of _GLIBCXX_USE_C99.
* testsuite/tr1/8_c_compatibility/cmath/templates.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_MATH.
* testsuite/tr1/8_c_compatibility/cstdio/functions.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
* testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
* testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc: Likewise.
* testsuite/tr1/8_c_compatibility/cwchar/functions.cc: Replace
_GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR.
* testsuite/util/testsuite_fs.h: Replace _GLIBCXX_USE_C99 with
_GLIBCXX_USE_C99_STDIO.

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

47 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/acinclude.m4
libstdc++-v3/config.h.in
libstdc++-v3/config/locale/dragonfly/c_locale.h
libstdc++-v3/config/locale/generic/c_locale.h
libstdc++-v3/config/locale/gnu/c_locale.h
libstdc++-v3/config/os/bsd/dragonfly/os_defines.h
libstdc++-v3/configure
libstdc++-v3/include/bits/basic_string.h
libstdc++-v3/include/bits/c++config
libstdc++-v3/include/bits/locale_facets.tcc
libstdc++-v3/include/bits/locale_facets_nonio.tcc
libstdc++-v3/include/c_compatibility/math.h
libstdc++-v3/include/c_compatibility/wchar.h
libstdc++-v3/include/c_global/cstdio
libstdc++-v3/include/c_global/cstdlib
libstdc++-v3/include/c_global/cwchar
libstdc++-v3/include/c_std/cstdio
libstdc++-v3/include/c_std/cstdlib
libstdc++-v3/include/c_std/cwchar
libstdc++-v3/include/ext/vstring.h
libstdc++-v3/include/std/complex
libstdc++-v3/include/tr1/cstdio
libstdc++-v3/include/tr1/cstdlib
libstdc++-v3/include/tr1/cwchar
libstdc++-v3/include/tr1/stdlib.h
libstdc++-v3/src/c++98/locale_facets.cc
libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc
libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stof.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoi.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stol.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoll.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoul.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoull.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/to_wstring.cc
libstdc++-v3/testsuite/26_numerics/headers/cstdlib/13943.cc
libstdc++-v3/testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc
libstdc++-v3/testsuite/lib/libstdc++.exp
libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/templates.cc
libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdio/functions.cc
libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/functions.cc
libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc
libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc
libstdc++-v3/testsuite/util/testsuite_fs.h

index ca688a09ecb8c54e4c141442b8a1955f2057f993..dd86ffb1eb4e5d74bea1d1b2882b7520f2d2b003 100644 (file)
@@ -1,3 +1,97 @@
+2015-11-13  Jennifer Yao  <jenny.hyphen.fa@gmail.com>
+           Jonathan Wakely  <jwakely@redhat.com>
+
+       PR libstdc++/58393
+       PR libstdc++/61580
+       * acinclude.m4 (GLIBCXX_ENABLE_C99): Perform tests twice, with
+       -std=c++11 as well as -std=c++98, and define separate macros for each.
+       Cache the results of checking for complex math and wide character
+       functions. Reformat for readability.
+       * config.h.in: Regenerate.
+       * include/bits/c++config: Define _GLIBCXX_USE_C99_XXX macros to
+       either _GLIBCXX98_USE_C99_XXX or _GLIBCXX11_USE_C99_XXX according to
+       language standard in use.
+       * config/locale/dragonfly/c_locale.h (std::__convert_from_v): Replace
+       _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
+       * config/locale/generic/c_locale.h (std::__convert_from_v): Likewise.
+       * config/locale/gnu/c_locale.h (std::__convert_from_v): Likewise.
+       * config/os/bsd/dragonfly/os_defines.h: Define _GLIBCXX_USE_C99_STDIO,
+       _GLIBCXX_USE_C99_STDLIB, and _GLIBCXX_USE_C99_WCHAR.
+       * configure: Regenerate.
+       * include/bits/basic_string.h: Make numeric conversion functions
+       depend on _GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, or
+       _GLIBCXX_USE_C99_WCHAR, instead of _GLIBCXX_USE_C99.
+       * include/ext/vstring.h: Likewise.
+       * include/bits/locale_facets.tcc (std::num_put::_M_insert_float):
+       Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
+       * include/bits/locale_facets_nonio.tcc (std::money_put::do_put):
+       Likewise.
+       * include/c_compatibility/math.h: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_MATH.
+       * include/c_compatibility/wchar.h: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_WCHAR.
+       * include/c_global/cstdio: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_STDIO.
+       * include/c_global/cstdlib: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_STDLIB.
+       * include/c_global/cwchar: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_WCHAR.
+       * include/c_std/cstdio: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_STDIO.
+       * include/c_std/cstdlib: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_STDLIB.
+       * include/c_std/cwchar: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_WCHAR.
+       * include/tr1/cstdio: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_STDIO.
+       * include/tr1/cstdlib: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_STDLIB.
+       * include/tr1/cwchar: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_WCHAR.
+       * include/tr1/stdlib.h: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_STDLIB.
+       * src/c++98/locale_facets.cc (std::__num_base::_S_format_float):
+       Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
+       * testsuite/18_support/exception_ptr/60612-terminate.cc: Replace
+       _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
+       * testsuite/18_support/exception_ptr/60612-unexpected.cc: Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc
+       (test01): Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR.
+       * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
+       stof.cc: Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
+       stoi.cc: Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
+       stol.cc: Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
+       stold.cc: Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
+       stoll.cc: Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
+       stoul.cc: Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
+       stoull.cc: Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/
+       to_wstring.cc: Likewise.
+       * testsuite/26_numerics/headers/cstdlib/13943.cc: Replace
+       _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
+       * testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc: Likewise.
+       * testsuite/lib/libstdc++.exp (check_v3_target_string_conversions):
+       Change preprocessor #if conditional so that it uses
+       _GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, and
+       _GLIBCXX_USE_C99_WCHAR, instead of _GLIBCXX_USE_C99.
+       * testsuite/tr1/8_c_compatibility/cmath/templates.cc: Replace
+       _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_MATH.
+       * testsuite/tr1/8_c_compatibility/cstdio/functions.cc: Replace
+       _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO.
+       * testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Replace
+       _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB.
+       * testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc: Likewise.
+       * testsuite/tr1/8_c_compatibility/cwchar/functions.cc: Replace
+       _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR.
+       * testsuite/util/testsuite_fs.h: Replace _GLIBCXX_USE_C99 with
+       _GLIBCXX_USE_C99_STDIO.
+
 2015-11-13  Jonathan Wakely  <jwakely@redhat.com>
 
        * include/experimental/bits/shared_ptr.h: Tweak comments.
index abf2e93afd4a4592a23427b26761f9c6e6d70994..deefa04155edbef7f987cd3f46b934fd76e79164 100644 (file)
@@ -915,234 +915,438 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [
   GLIBCXX_ENABLE(c99,$1,,[turns on ISO/IEC 9899:1999 support])
 
   if test x"$enable_c99" = x"yes"; then
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
 
-  AC_LANG_SAVE
-  AC_LANG_CPLUSPLUS
+    # Use -std=c++98 (instead of -std=gnu++98) because leaving __STRICT_ANSI__
+    # undefined may cause fake C99 facilities, like pre-standard snprintf,
+    # to be spuriously enabled.
+    ac_save_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="$CXXFLAGS -std=c++98"
+    ac_save_LIBS="$LIBS"
+    ac_save_gcc_no_link="$gcc_no_link"
+
+    if test x$gcc_no_link != xyes; then
+      # Use -fno-exceptions to that the C driver can link these tests without
+      # hitting undefined references to personality routines.
+      CXXFLAGS="$CXXFLAGS -fno-exceptions"
+      AC_CHECK_LIB(m, sin, [LIBS="$LIBS -lm"], [
+        # Use the default compile-only tests in GCC_TRY_COMPILE_OR_LINK
+        gcc_no_link=yes
+      ])
+    fi
 
-  # Use -std=c++98 because the default (-std=gnu++98) leaves __STRICT_ANSI__
-  # undefined and fake C99 facilities - like pre-standard snprintf - may be
-  # spuriously enabled.
-  # Long term, -std=c++0x could be even better, could manage to explicitly
-  # request C99 facilities to the underlying C headers.
-  ac_save_CXXFLAGS="$CXXFLAGS"
-  CXXFLAGS="$CXXFLAGS -std=c++98"
-  ac_save_LIBS="$LIBS"
-  ac_save_gcc_no_link="$gcc_no_link"
+    # Check for the existence of <math.h> functions used if C99 is enabled.
+    AC_MSG_CHECKING([for ISO C99 support in <math.h> for C++98])
+    AC_CACHE_VAL(glibcxx_cv_c99_math_cxx98, [
+      GCC_TRY_COMPILE_OR_LINK(
+        [#include <math.h>
+         volatile double d1, d2;
+         volatile int i;],
+        [i = fpclassify(d1);
+         i = isfinite(d1);
+         i = isinf(d1);
+         i = isnan(d1);
+         i = isnormal(d1);
+         i = signbit(d1);
+         i = isgreater(d1, d2);
+         i = isgreaterequal(d1, d2);
+         i = isless(d1, d2);
+         i = islessequal(d1, d2);
+         i = islessgreater(d1, d2);
+         i = islessgreater(d1, d2);
+         i = isunordered(d1, d2);
+        ], [glibcxx_cv_c99_math_cxx98=yes], [glibcxx_cv_c99_math_cxx98=no])
+    ])
+    AC_MSG_RESULT($glibcxx_cv_c99_math_cxx98)
+    if test x"$glibcxx_cv_c99_math_cxx98" = x"yes"; then
+      AC_DEFINE(_GLIBCXX98_USE_C99_MATH, 1,
+        [Define if C99 functions or macros in <math.h> should be imported
+        in <cmath> in namespace std for C++98.])
+    fi
 
-  if test x$gcc_no_link != xyes; then
-    # Use -fno-exceptions to that the C driver can link these tests without
-    # hitting undefined references to personality routines.
-    CXXFLAGS="$CXXFLAGS -fno-exceptions"
-    AC_CHECK_LIB(m, sin, [
-      LIBS="$LIBS -lm"
-    ], [
-      # Use the default compile-only tests in GCC_TRY_COMPILE_OR_LINK
-      gcc_no_link=yes
+    # Check for the existence of <complex.h> complex math functions.
+    # This is necessary even though libstdc++ uses the builtin versions
+    # of these functions, because if the builtin cannot be used, a reference
+    # to the library function is emitted.
+    AC_CHECK_HEADERS(tgmath.h, ac_has_tgmath_h=yes, ac_has_tgmath_h=no)
+    AC_CHECK_HEADERS(complex.h, ac_has_complex_h=yes, ac_has_complex_h=no)
+    if test x"$ac_has_complex_h" = x"yes"; then
+      AC_MSG_CHECKING([for ISO C99 support in <complex.h> for C++98])
+      AC_CACHE_VAL(glibcxx_cv_c99_complex_cxx98, [
+        GCC_TRY_COMPILE_OR_LINK(
+          [#include <complex.h>
+           typedef __complex__ float float_type;
+           typedef __complex__ double double_type;
+           typedef __complex__ long double ld_type;
+           volatile float_type tmpf;
+           volatile double_type tmpd;
+           volatile ld_type tmpld;
+           volatile float f;
+           volatile double d;
+           volatile long double ld;],
+          [f = cabsf(tmpf);
+           f = cargf(tmpf);
+           tmpf = ccosf(tmpf);
+           tmpf = ccoshf(tmpf);
+           tmpf = cexpf(tmpf);
+           tmpf = clogf(tmpf);
+           tmpf = csinf(tmpf);
+           tmpf = csinhf(tmpf);
+           tmpf = csqrtf(tmpf);
+           tmpf = ctanf(tmpf);
+           tmpf = ctanhf(tmpf);
+           tmpf = cpowf(tmpf, tmpf);
+           tmpf = cprojf(tmpf);
+           d = cabs(tmpd);
+           d = carg(tmpd);
+           tmpd = ccos(tmpd);
+           tmpd = ccosh(tmpd);
+           tmpd = cexp(tmpd);
+           tmpd = clog(tmpd);
+           tmpd = csin(tmpd);
+           tmpd = csinh(tmpd);
+           tmpd = csqrt(tmpd);
+           tmpd = ctan(tmpd);
+           tmpd = ctanh(tmpd);
+           tmpd = cpow(tmpd, tmpd);
+           tmpd = cproj(tmpd);
+           ld = cabsl(tmpld);
+           ld = cargl(tmpld);
+           tmpld = ccosl(tmpld);
+           tmpld = ccoshl(tmpld);
+           tmpld = cexpl(tmpld);
+           tmpld = clogl(tmpld);
+           tmpld = csinl(tmpld);
+           tmpld = csinhl(tmpld);
+           tmpld = csqrtl(tmpld);
+           tmpld = ctanl(tmpld);
+           tmpld = ctanhl(tmpld);
+           tmpld = cpowl(tmpld, tmpld);
+           tmpld = cprojl(tmpld);
+          ], [glibcxx_cv_c99_complex_cxx98=yes], [glibcxx_cv_c99_complex_cxx98=no])
+      ])
+    fi
+    AC_MSG_RESULT($glibcxx_cv_c99_complex_cxx98)
+    if test x"$glibcxx_cv_c99_complex_cxx98" = x"yes"; then
+      AC_DEFINE(_GLIBCXX98_USE_C99_COMPLEX, 1,
+        [Define if C99 functions in <complex.h> should be used in
+        <complex> for C++98. Using compiler builtins for these functions
+        requires corresponding C99 library functions to be present.])
+    fi
+
+    # Check for the existence in <stdio.h> of vscanf, et. al.
+    AC_MSG_CHECKING([for ISO C99 support in <stdio.h> for C++98])
+    AC_CACHE_VAL(glibcxx_cv_c99_stdio_cxx98, [
+      GCC_TRY_COMPILE_OR_LINK(
+        [#include <stdio.h>
+         #include <stdarg.h>
+         void foo(char* fmt, ...)
+         {
+           va_list args; va_start(args, fmt);
+           vfscanf(stderr, "%i", args);
+           vscanf("%i", args);
+           vsnprintf(fmt, 0, "%i", args);
+           vsscanf(fmt, "%i", args);
+           snprintf(fmt, 0, "%i");
+         }], [],
+        [glibcxx_cv_c99_stdio_cxx98=yes], [glibcxx_cv_c99_stdio_cxx98=no])
     ])
-  fi
+    AC_MSG_RESULT($glibcxx_cv_c99_stdio_cxx98)
+    if test x"$glibcxx_cv_c99_stdio_cxx98" = x"yes"; then
+      AC_DEFINE(_GLIBCXX98_USE_C99_STDIO, 1,
+        [Define if C99 functions or macros in <stdio.h> should be imported
+        in <cstdio> in namespace std for C++98.])
+    fi
 
-  # Check for the existence of <math.h> functions used if C99 is enabled.
-  AC_MSG_CHECKING([for ISO C99 support in <math.h>])
-  AC_CACHE_VAL(glibcxx_cv_c99_math, [
-  GCC_TRY_COMPILE_OR_LINK(
-     [#include <math.h>
-      volatile double d1, d2;
-      volatile int i;],
-     [i = fpclassify(d1);
-      i = isfinite(d1);
-      i = isinf(d1);
-      i = isnan(d1);
-      i = isnormal(d1);
-      i = signbit(d1);
-      i = isgreater(d1, d2);
-      i = isgreaterequal(d1, d2);
-      i = isless(d1, d2);
-      i = islessequal(d1, d2);
-      i = islessgreater(d1, d2);
-      i = islessgreater(d1, d2);
-      i = isunordered(d1, d2);
-     ],[glibcxx_cv_c99_math=yes], [glibcxx_cv_c99_math=no])
-  ])
-  AC_MSG_RESULT($glibcxx_cv_c99_math)
-  if test x"$glibcxx_cv_c99_math" = x"yes"; then
-    AC_DEFINE(_GLIBCXX_USE_C99_MATH, 1,
-             [Define if C99 functions or macros in <math.h> should be imported
-             in <cmath> in namespace std.])
-  fi
+    # Check for the existence in <wchar.h> of wcstold, etc.
+    if test x"$ac_has_wchar_h" = xyes &&
+       test x"$ac_has_wctype_h" = xyes; then
+      AC_MSG_CHECKING([for ISO C99 support in <wchar.h> for C++98])
+      AC_CACHE_VAL(glibcxx_cv_c99_wchar_cxx98, [
+        AC_TRY_COMPILE([#include <wchar.h>
+          namespace test
+          {
+            using ::wcstold;
+            using ::wcstoll;
+            using ::wcstoull;
+          }
+        ], [], [glibcxx_cv_c99_wchar_cxx98=yes], [glibcxx_cv_c99_wchar_cxx98=no])
+      ])
 
-  # Check for the existence of <complex.h> complex math functions.
-  # This is necessary even though libstdc++ uses the builtin versions
-  # of these functions, because if the builtin cannot be used, a reference
-  # to the library function is emitted.
-  AC_CHECK_HEADERS(tgmath.h, ac_has_tgmath_h=yes, ac_has_tgmath_h=no)
-  AC_CHECK_HEADERS(complex.h, ac_has_complex_h=yes, ac_has_complex_h=no)
-  glibcxx_cv_c99_complex=no;
-  if test x"$ac_has_complex_h" = x"yes"; then
-    AC_MSG_CHECKING([for ISO C99 support in <complex.h>])
-    GCC_TRY_COMPILE_OR_LINK(
-       [#include <complex.h>
-       typedef __complex__ float float_type;
-       typedef __complex__ double double_type;
-       typedef __complex__ long double ld_type;
-       volatile float_type tmpf;
-       volatile double_type tmpd;
-       volatile ld_type tmpld;
-       volatile float f;
-       volatile double d;
-       volatile long double ld;],
-       [f = cabsf(tmpf);
-       f = cargf(tmpf);
-       tmpf = ccosf(tmpf);
-       tmpf = ccoshf(tmpf);
-       tmpf = cexpf(tmpf);
-       tmpf = clogf(tmpf);
-       tmpf = csinf(tmpf);
-       tmpf = csinhf(tmpf);
-       tmpf = csqrtf(tmpf);
-       tmpf = ctanf(tmpf);
-       tmpf = ctanhf(tmpf);
-       tmpf = cpowf(tmpf, tmpf);
-       tmpf = cprojf(tmpf);
-       d = cabs(tmpd);
-       d = carg(tmpd);
-       tmpd = ccos(tmpd);
-       tmpd = ccosh(tmpd);
-       tmpd = cexp(tmpd);
-       tmpd = clog(tmpd);
-       tmpd = csin(tmpd);
-       tmpd = csinh(tmpd);
-       tmpd = csqrt(tmpd);
-       tmpd = ctan(tmpd);
-       tmpd = ctanh(tmpd);
-       tmpd = cpow(tmpd, tmpd);
-       tmpd = cproj(tmpd);
-       ld = cabsl(tmpld);
-       ld = cargl(tmpld);
-       tmpld = ccosl(tmpld);
-       tmpld = ccoshl(tmpld);
-       tmpld = cexpl(tmpld);
-       tmpld = clogl(tmpld);
-       tmpld = csinl(tmpld);
-       tmpld = csinhl(tmpld);
-       tmpld = csqrtl(tmpld);
-       tmpld = ctanl(tmpld);
-       tmpld = ctanhl(tmpld);
-       tmpld = cpowl(tmpld, tmpld);
-       tmpld = cprojl(tmpld);
-       ],[glibcxx_cv_c99_complex=yes], [glibcxx_cv_c99_complex=no])
-  fi
-  AC_MSG_RESULT($glibcxx_cv_c99_complex)
-  if test x"$glibcxx_cv_c99_complex" = x"yes"; then
-    AC_DEFINE(_GLIBCXX_USE_C99_COMPLEX, 1,
-             [Define if C99 functions in <complex.h> should be used in
-             <complex>. Using compiler builtins for these functions requires
-             corresponding C99 library functions to be present.])
-  fi
-
-  # Check for the existence in <stdio.h> of vscanf, et. al.
-  AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
-  AC_CACHE_VAL(glibcxx_cv_c99_stdio, [
-  GCC_TRY_COMPILE_OR_LINK(
-     [#include <stdio.h>
-      #include <stdarg.h>
-      void foo(char* fmt, ...)
-      {
-       va_list args; va_start(args, fmt);
-       vfscanf(stderr, "%i", args);
-       vscanf("%i", args);
-       vsnprintf(fmt, 0, "%i", args);
-       vsscanf(fmt, "%i", args);
-       snprintf(fmt, 0, "%i");
-      }], [],
-     [glibcxx_cv_c99_stdio=yes], [glibcxx_cv_c99_stdio=no])
-  ])
-  AC_MSG_RESULT($glibcxx_cv_c99_stdio)
-
-  # Check for the existence in <stdlib.h> of lldiv_t, et. al.
-  AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
-  AC_CACHE_VAL(glibcxx_cv_c99_stdlib, [
-  GCC_TRY_COMPILE_OR_LINK(
-     [#include <stdlib.h>
-      volatile float f;
-      volatile long double ld;
-      volatile unsigned long long ll;
-      lldiv_t mydivt;],
-     [char* tmp;
-      f = strtof("gnu", &tmp);
-      ld = strtold("gnu", &tmp);
-      ll = strtoll("gnu", &tmp, 10);
-      ll = strtoull("gnu", &tmp, 10);
-      ll = llabs(10);
-      mydivt = lldiv(10,1);
-      ll = mydivt.quot;
-      ll = mydivt.rem;
-      ll = atoll("10");
-      _Exit(0);
-      ],[glibcxx_cv_c99_stdlib=yes], [glibcxx_cv_c99_stdlib=no])
-  ])
-  AC_MSG_RESULT($glibcxx_cv_c99_stdlib)
-
-  # Check for the existence in <wchar.h> of wcstold, etc.
-  glibcxx_cv_c99_wchar=no;
-  if test x"$ac_has_wchar_h" = xyes &&
-     test x"$ac_has_wctype_h" = xyes; then
-    AC_MSG_CHECKING([for ISO C99 support in <wchar.h>])
-    AC_TRY_COMPILE([#include <wchar.h>
-                   namespace test
-                   {
-                     using ::wcstold;
-                     using ::wcstoll;
-                     using ::wcstoull;
-                   }
-                  ],[],[glibcxx_cv_c99_wchar=yes], [glibcxx_cv_c99_wchar=no])
-
-    # Checks for wide character functions that may not be present.
-    # Injection of these is wrapped with guard macros.
-    # NB: only put functions here, instead of immediately above, if
-    # absolutely necessary.
-    AC_TRY_COMPILE([#include <wchar.h>
-                   namespace test { using ::vfwscanf; } ], [],
-                  [AC_DEFINE(HAVE_VFWSCANF,1,
-                       [Defined if vfwscanf exists.])],[])
-
-    AC_TRY_COMPILE([#include <wchar.h>
-                   namespace test { using ::vswscanf; } ], [],
-                  [AC_DEFINE(HAVE_VSWSCANF,1,
-                       [Defined if vswscanf exists.])],[])
-
-    AC_TRY_COMPILE([#include <wchar.h>
-                   namespace test { using ::vwscanf; } ], [],
-                  [AC_DEFINE(HAVE_VWSCANF,1,[Defined if vwscanf exists.])],[])
-
-    AC_TRY_COMPILE([#include <wchar.h>
-                   namespace test { using ::wcstof; } ], [],
-                  [AC_DEFINE(HAVE_WCSTOF,1,[Defined if wcstof exists.])],[])
-
-    AC_TRY_COMPILE([#include <wctype.h>],
-                  [ wint_t t; int i = iswblank(t);],
-                  [AC_DEFINE(HAVE_ISWBLANK,1,
-                       [Defined if iswblank exists.])],[])
-
-    AC_MSG_RESULT($glibcxx_cv_c99_wchar)
-  fi
-
-  # Option parsed, now set things appropriately.
-  if test x"$glibcxx_cv_c99_math" = x"no" ||
-     test x"$glibcxx_cv_c99_complex" = x"no" ||
-     test x"$glibcxx_cv_c99_stdio" = x"no" ||
-     test x"$glibcxx_cv_c99_stdlib" = x"no" ||
-     test x"$glibcxx_cv_c99_wchar" = x"no"; then
-    enable_c99=no;
-  else
-    AC_DEFINE(_GLIBCXX_USE_C99, 1,
-    [Define if C99 functions or macros from <wchar.h>, <math.h>,
-    <complex.h>, <stdio.h>, and <stdlib.h> can be used or exposed.])
-  fi
+      # Checks for wide character functions that may not be present.
+      # Injection of these is wrapped with guard macros.
+      # NB: only put functions here, instead of immediately above, if
+      # absolutely necessary.
+      AC_TRY_COMPILE([#include <wchar.h>
+        namespace test { using ::vfwscanf; }], [],
+        [AC_DEFINE(HAVE_VFWSCANF, 1, [Defined if vfwscanf exists.])], [])
 
-  gcc_no_link="$ac_save_gcc_no_link"
-  LIBS="$ac_save_LIBS"
-  CXXFLAGS="$ac_save_CXXFLAGS"
-  AC_LANG_RESTORE
+      AC_TRY_COMPILE([#include <wchar.h>
+        namespace test { using ::vswscanf; }], [],
+        [AC_DEFINE(HAVE_VSWSCANF, 1, [Defined if vswscanf exists.])], [])
+
+      AC_TRY_COMPILE([#include <wchar.h>
+        namespace test { using ::vwscanf; }], [],
+        [AC_DEFINE(HAVE_VWSCANF, 1, [Defined if vwscanf exists.])], [])
+
+      AC_TRY_COMPILE([#include <wchar.h>
+        namespace test { using ::wcstof; }], [],
+        [AC_DEFINE(HAVE_WCSTOF, 1, [Defined if wcstof exists.])], [])
+
+      AC_TRY_COMPILE([#include <wctype.h>],
+        [wint_t t; int i = iswblank(t);],
+        [AC_DEFINE(HAVE_ISWBLANK, 1, [Defined if iswblank exists.])], [])
+
+      AC_MSG_RESULT($glibcxx_cv_c99_wchar_cxx98)
+      if test x"$glibcxx_cv_c99_wchar_cxx98" = x"yes"; then
+        AC_DEFINE(_GLIBCXX98_USE_C99_WCHAR, 1,
+          [Define if C99 functions or macros in <wchar.h> should be imported
+          in <cwchar> in namespace std for C++98.])
+      fi
+    fi
+
+    # Option parsed, now set things appropriately.
+    if test x"$glibcxx_cv_c99_math_cxx98" = x"no" ||
+       test x"$glibcxx_cv_c99_complex_cxx98" = x"no" ||
+       test x"$glibcxx_cv_c99_stdio_cxx98" = x"no" ||
+       test x"$glibcxx_cv_c99_stdlib_cxx98" = x"no" ||
+       test x"$glibcxx_cv_c99_wchar_cxx98" = x"no"; then
+      enable_c99=no;
+    else
+      AC_DEFINE(_GLIBCXX_USE_C99, 1,
+        [Define if C99 functions or macros from <wchar.h>, <math.h>,
+        <complex.h>, <stdio.h>, and <stdlib.h> can be used or exposed.])
+    fi
+
+    gcc_no_link="$ac_save_gcc_no_link"
+    LIBS="$ac_save_LIBS"
+    CXXFLAGS="$ac_save_CXXFLAGS"
+    AC_LANG_RESTORE
+
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+
+    # Use -std=c++11 and test again for C99 library feature in C++11 mode.
+    # For the reasons given above we use -std=c++11 not -std=gnu++11.
+    ac_save_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="$CXXFLAGS -std=c++11"
+    ac_save_LIBS="$LIBS"
+    ac_save_gcc_no_link="$gcc_no_link"
+
+    if test x$gcc_no_link != xyes; then
+      # Use -fno-exceptions to that the C driver can link these tests without
+      # hitting undefined references to personality routines.
+      CXXFLAGS="$CXXFLAGS -fno-exceptions"
+      AC_CHECK_LIB(m, sin, [LIBS="$LIBS -lm"], [
+        # Use the default compile-only tests in GCC_TRY_COMPILE_OR_LINK
+        gcc_no_link=yes
+      ])
+    fi
+
+    # Check for the existence of <math.h> functions used if C99 is enabled.
+    AC_MSG_CHECKING([for ISO C99 support in <math.h> for C++11])
+    AC_CACHE_VAL(glibcxx_cv_c99_math_cxx11, [
+      GCC_TRY_COMPILE_OR_LINK(
+        [#include <math.h>
+         volatile double d1, d2;
+         volatile int i;],
+        [i = fpclassify(d1);
+         i = isfinite(d1);
+         i = isinf(d1);
+         i = isnan(d1);
+         i = isnormal(d1);
+         i = signbit(d1);
+         i = isgreater(d1, d2);
+         i = isgreaterequal(d1, d2);
+         i = isless(d1, d2);
+         i = islessequal(d1, d2);
+         i = islessgreater(d1, d2);
+         i = islessgreater(d1, d2);
+         i = isunordered(d1, d2);
+        ], [glibcxx_cv_c99_math_cxx11=yes], [glibcxx_cv_c99_math_cxx11=no])
+    ])
+    AC_MSG_RESULT($glibcxx_cv_c99_math_cxx11)
+    if test x"$glibcxx_cv_c99_math_cxx11" = x"yes"; then
+      AC_DEFINE(_GLIBCXX11_USE_C99_MATH, 1,
+        [Define if C99 functions or macros in <math.h> should be imported
+        in <cmath> in namespace std for C++11.])
+    fi
+
+    # Check for the existence of <complex.h> complex math functions.
+    # This is necessary even though libstdc++ uses the builtin versions
+    # of these functions, because if the builtin cannot be used, a reference
+    # to the library function is emitted.
+    AC_CHECK_HEADERS(tgmath.h, ac_has_tgmath_h=yes, ac_has_tgmath_h=no)
+    AC_CHECK_HEADERS(complex.h, ac_has_complex_h=yes, ac_has_complex_h=no)
+    if test x"$ac_has_complex_h" = x"yes"; then
+      AC_MSG_CHECKING([for ISO C99 support in <complex.h> for C++11])
+      AC_CACHE_VAL(glibcxx_cv_c99_complex_cxx11, [
+        GCC_TRY_COMPILE_OR_LINK(
+          [#include <complex.h>
+           typedef __complex__ float float_type;
+           typedef __complex__ double double_type;
+           typedef __complex__ long double ld_type;
+           volatile float_type tmpf;
+           volatile double_type tmpd;
+           volatile ld_type tmpld;
+           volatile float f;
+           volatile double d;
+           volatile long double ld;],
+          [f = cabsf(tmpf);
+           f = cargf(tmpf);
+           tmpf = ccosf(tmpf);
+           tmpf = ccoshf(tmpf);
+           tmpf = cexpf(tmpf);
+           tmpf = clogf(tmpf);
+           tmpf = csinf(tmpf);
+           tmpf = csinhf(tmpf);
+           tmpf = csqrtf(tmpf);
+           tmpf = ctanf(tmpf);
+           tmpf = ctanhf(tmpf);
+           tmpf = cpowf(tmpf, tmpf);
+           tmpf = cprojf(tmpf);
+           d = cabs(tmpd);
+           d = carg(tmpd);
+           tmpd = ccos(tmpd);
+           tmpd = ccosh(tmpd);
+           tmpd = cexp(tmpd);
+           tmpd = clog(tmpd);
+           tmpd = csin(tmpd);
+           tmpd = csinh(tmpd);
+           tmpd = csqrt(tmpd);
+           tmpd = ctan(tmpd);
+           tmpd = ctanh(tmpd);
+           tmpd = cpow(tmpd, tmpd);
+           tmpd = cproj(tmpd);
+           ld = cabsl(tmpld);
+           ld = cargl(tmpld);
+           tmpld = ccosl(tmpld);
+           tmpld = ccoshl(tmpld);
+           tmpld = cexpl(tmpld);
+           tmpld = clogl(tmpld);
+           tmpld = csinl(tmpld);
+           tmpld = csinhl(tmpld);
+           tmpld = csqrtl(tmpld);
+           tmpld = ctanl(tmpld);
+           tmpld = ctanhl(tmpld);
+           tmpld = cpowl(tmpld, tmpld);
+           tmpld = cprojl(tmpld);
+          ], [glibcxx_cv_c99_complex_cxx11=yes], [glibcxx_cv_c99_complex_cxx11=no])
+      ])
+    fi
+    AC_MSG_RESULT($glibcxx_cv_c99_complex_cxx11)
+    if test x"$glibcxx_cv_c99_complex_cxx11" = x"yes"; then
+      AC_DEFINE(_GLIBCXX11_USE_C99_COMPLEX, 1,
+        [Define if C99 functions in <complex.h> should be used in
+        <complex> for C++11. Using compiler builtins for these functions
+        requires corresponding C99 library functions to be present.])
+    fi
+
+    # Check for the existence in <stdio.h> of vscanf, et. al.
+    AC_MSG_CHECKING([for ISO C99 support in <stdio.h> for C++11])
+    AC_CACHE_VAL(glibcxx_cv_c99_stdio_cxx11, [
+      GCC_TRY_COMPILE_OR_LINK(
+        [#include <stdio.h>
+         #include <stdarg.h>
+         void foo(char* fmt, ...)
+         {
+           va_list args; va_start(args, fmt);
+           vfscanf(stderr, "%i", args);
+           vscanf("%i", args);
+           vsnprintf(fmt, 0, "%i", args);
+           vsscanf(fmt, "%i", args);
+           snprintf(fmt, 0, "%i");
+         }], [],
+        [glibcxx_cv_c99_stdio_cxx11=yes], [glibcxx_cv_c99_stdio_cxx11=no])
+    ])
+    AC_MSG_RESULT($glibcxx_cv_c99_stdio_cxx11)
+    if test x"$glibcxx_cv_c99_stdio_cxx11" = x"yes"; then
+      AC_DEFINE(_GLIBCXX11_USE_C99_STDIO, 1,
+        [Define if C99 functions or macros in <stdio.h> should be imported
+        in <cstdio> in namespace std for C++11.])
+    fi
+
+    # Check for the existence in <stdlib.h> of lldiv_t, et. al.
+    AC_MSG_CHECKING([for ISO C99 support in <stdlib.h> for C++11])
+    AC_CACHE_VAL(glibcxx_cv_c99_stdlib_cxx11, [
+      GCC_TRY_COMPILE_OR_LINK(
+        [#include <stdlib.h>
+         volatile float f;
+         volatile long double ld;
+         volatile unsigned long long ll;
+         lldiv_t mydivt;],
+        [char* tmp;
+         f = strtof("gnu", &tmp);
+         ld = strtold("gnu", &tmp);
+         ll = strtoll("gnu", &tmp, 10);
+         ll = strtoull("gnu", &tmp, 10);
+         ll = llabs(10);
+         mydivt = lldiv(10,1);
+         ll = mydivt.quot;
+         ll = mydivt.rem;
+         ll = atoll("10");
+         _Exit(0);
+        ], [glibcxx_cv_c99_stdlib_cxx11=yes], [glibcxx_cv_c99_stdlib_cxx11=no])
+    ])
+    AC_MSG_RESULT($glibcxx_cv_c99_stdlib_cxx11)
+    if test x"$glibcxx_cv_c99_stdlib_cxx11" = x"yes"; then
+      AC_DEFINE(_GLIBCXX11_USE_C99_STDLIB, 1,
+        [Define if C99 functions or macros in <stdlib.h> should be imported
+        in <cstdlib> in namespace std for C++11.])
+    fi
+
+    # Check for the existence in <wchar.h> of wcstold, etc.
+    if test x"$ac_has_wchar_h" = xyes &&
+       test x"$ac_has_wctype_h" = xyes; then
+      AC_MSG_CHECKING([for ISO C99 support in <wchar.h> for C++11])
+      AC_CACHE_VAL(glibcxx_cv_c99_wchar_cxx11, [
+        AC_TRY_COMPILE([#include <wchar.h>
+          namespace test
+          {
+            using ::wcstold;
+            using ::wcstoll;
+            using ::wcstoull;
+          }
+        ], [], [glibcxx_cv_c99_wchar_cxx11=yes], [glibcxx_cv_c99_wchar_cxx11=no])
+      ])
+
+      # Checks for wide character functions that may not be present.
+      # Injection of these is wrapped with guard macros.
+      # NB: only put functions here, instead of immediately above, if
+      # absolutely necessary.
+      AC_TRY_COMPILE([#include <wchar.h>
+        namespace test { using ::vfwscanf; }], [],
+        [AC_DEFINE(HAVE_VFWSCANF, 1, [Defined if vfwscanf exists.])], [])
+
+      AC_TRY_COMPILE([#include <wchar.h>
+        namespace test { using ::vswscanf; }], [],
+        [AC_DEFINE(HAVE_VSWSCANF, 1, [Defined if vswscanf exists.])], [])
+
+      AC_TRY_COMPILE([#include <wchar.h>
+        namespace test { using ::vwscanf; }], [],
+        [AC_DEFINE(HAVE_VWSCANF, 1, [Defined if vwscanf exists.])], [])
+
+      AC_TRY_COMPILE([#include <wchar.h>
+        namespace test { using ::wcstof; }], [],
+        [AC_DEFINE(HAVE_WCSTOF, 1, [Defined if wcstof exists.])], [])
+
+      AC_TRY_COMPILE([#include <wctype.h>],
+        [wint_t t; int i = iswblank(t);],
+        [AC_DEFINE(HAVE_ISWBLANK, 1, [Defined if iswblank exists.])], [])
+
+      AC_MSG_RESULT($glibcxx_cv_c99_wchar_cxx11)
+      if test x"$glibcxx_cv_c99_wchar_cxx11" = x"yes"; then
+        AC_DEFINE(_GLIBCXX11_USE_C99_WCHAR, 1,
+          [Define if C99 functions or macros in <wchar.h> should be imported
+          in <cwchar> in namespace std for C++11.])
+      fi
+    fi
+
+    gcc_no_link="$ac_save_gcc_no_link"
+    LIBS="$ac_save_LIBS"
+    CXXFLAGS="$ac_save_CXXFLAGS"
+    AC_LANG_RESTORE
   fi
 
   AC_MSG_CHECKING([for fully enabled ISO C99 support])
index 8ae1c5bfe6950e52f7e5b46bc6d443c355120213..f58b2f4e94e01b5b48ba527201bb53462d0fd69b 100644 (file)
 /* Version number of package */
 #undef VERSION
 
+/* Define if C99 functions in <complex.h> should be used in <complex> for
+   C++11. Using compiler builtins for these functions requires corresponding
+   C99 library functions to be present. */
+#undef _GLIBCXX11_USE_C99_COMPLEX
+
+/* Define if C99 functions or macros in <math.h> should be imported in <cmath>
+   in namespace std for C++11. */
+#undef _GLIBCXX11_USE_C99_MATH
+
+/* Define if C99 functions or macros in <stdio.h> should be imported in
+   <cstdio> in namespace std for C++11. */
+#undef _GLIBCXX11_USE_C99_STDIO
+
+/* Define if C99 functions or macros in <stdlib.h> should be imported in
+   <cstdlib> in namespace std for C++11. */
+#undef _GLIBCXX11_USE_C99_STDLIB
+
+/* Define if C99 functions or macros in <wchar.h> should be imported in
+   <cwchar> in namespace std for C++11. */
+#undef _GLIBCXX11_USE_C99_WCHAR
+
+/* Define if C99 functions in <complex.h> should be used in <complex> for
+   C++98. Using compiler builtins for these functions requires corresponding
+   C99 library functions to be present. */
+#undef _GLIBCXX98_USE_C99_COMPLEX
+
+/* Define if C99 functions or macros in <math.h> should be imported in <cmath>
+   in namespace std for C++98. */
+#undef _GLIBCXX98_USE_C99_MATH
+
+/* Define if C99 functions or macros in <stdio.h> should be imported in
+   <cstdio> in namespace std for C++98. */
+#undef _GLIBCXX98_USE_C99_STDIO
+
+/* Define if C99 functions or macros in <wchar.h> should be imported in
+   <cwchar> in namespace std for C++98. */
+#undef _GLIBCXX98_USE_C99_WCHAR
+
 /* Define if the compiler supports C++11 atomics. */
 #undef _GLIBCXX_ATOMIC_BUILTINS
 
    <stdio.h>, and <stdlib.h> can be used or exposed. */
 #undef _GLIBCXX_USE_C99
 
-/* Define if C99 functions in <complex.h> should be used in <complex>. Using
-   compiler builtins for these functions requires corresponding C99 library
-   functions to be present. */
-#undef _GLIBCXX_USE_C99_COMPLEX
-
 /* Define if C99 functions in <complex.h> should be used in <tr1/complex>.
    Using compiler builtins for these functions requires corresponding C99
    library functions to be present. */
    <tr1/cinttypes> in namespace std::tr1. */
 #undef _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
 
-/* Define if C99 functions or macros in <math.h> should be imported in <cmath>
-   in namespace std. */
-#undef _GLIBCXX_USE_C99_MATH
-
 /* Define if C99 functions or macros in <math.h> should be imported in
    <tr1/cmath> in namespace std::tr1. */
 #undef _GLIBCXX_USE_C99_MATH_TR1
index 5c17cfe10c3af04d4fb260aed16fa52d4b2b1d67..867a4042cf9322407e619844236adfe6ccc6bf82 100644 (file)
@@ -64,7 +64,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     __builtin_va_list __args;
     __builtin_va_start(__args, __fmt);
 
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
 #else
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
index ee3ef8698b2992f0bb4e75bf60cb8ea052667ec6..fa7629f9b4aeb959c579c1cc4ecd40cf675abea6 100644 (file)
@@ -70,7 +70,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     __builtin_va_list __args;
     __builtin_va_start(__args, __fmt);
 
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
 #else
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
index a1dc3d2913b687bb49806e7bf2aa9b3b9b51d7df..f8ddfebb544d72bd4418946b60402c483400d3d0 100644 (file)
@@ -88,7 +88,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     __builtin_va_list __args;
     __builtin_va_start(__args, __fmt);
 
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
 #else
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
index 2209129145a033895e30420df65b0de35946df55..055c5b657b056801cb6d15fe23fd0e649b61058c 100644 (file)
@@ -30,6 +30,9 @@
 // file will come before all others.
 
 #define _GLIBCXX_USE_C99 1
+#define _GLIBCXX_USE_C99_STDIO 1
+#define _GLIBCXX_USE_C99_STDLIB 1
+#define _GLIBCXX_USE_C99_WCHAR 1
 #define _GLIBCXX_USE_C99_CHECK 1
 #define _GLIBCXX_USE_C99_DYNAMIC (!(__ISO_C_VISIBLE >= 1999))
 #define _GLIBCXX_USE_C99_LONG_LONG_CHECK 1
index 1eb6db4ec4cde4f0218089f01675bb82b51fbbbe..991818b3707d03b68b0a3bb928cdc5eeeac9eb0c 100755 (executable)
 
   if test x"$enable_c99" = x"yes"; then
 
-
-  ac_ext=cpp
+    ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
-  # Use -std=c++98 because the default (-std=gnu++98) leaves __STRICT_ANSI__
-  # undefined and fake C99 facilities - like pre-standard snprintf - may be
-  # spuriously enabled.
-  # Long term, -std=c++0x could be even better, could manage to explicitly
-  # request C99 facilities to the underlying C headers.
-  ac_save_CXXFLAGS="$CXXFLAGS"
-  CXXFLAGS="$CXXFLAGS -std=c++98"
-  ac_save_LIBS="$LIBS"
-  ac_save_gcc_no_link="$gcc_no_link"
+    # Use -std=c++98 (instead of -std=gnu++98) because leaving __STRICT_ANSI__
+    # undefined may cause fake C99 facilities, like pre-standard snprintf,
+    # to be spuriously enabled.
+    ac_save_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="$CXXFLAGS -std=c++98"
+    ac_save_LIBS="$LIBS"
+    ac_save_gcc_no_link="$gcc_no_link"
 
-  if test x$gcc_no_link != xyes; then
-    # Use -fno-exceptions to that the C driver can link these tests without
-    # hitting undefined references to personality routines.
-    CXXFLAGS="$CXXFLAGS -fno-exceptions"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5
+    if test x$gcc_no_link != xyes; then
+      # Use -fno-exceptions to that the C driver can link these tests without
+      # hitting undefined references to personality routines.
+      CXXFLAGS="$CXXFLAGS -fno-exceptions"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5
 $as_echo_n "checking for sin in -lm... " >&6; }
 if test "${ac_cv_lib_m_sin+set}" = set; then :
   $as_echo_n "(cached) " >&6
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5
 $as_echo "$ac_cv_lib_m_sin" >&6; }
 if test "x$ac_cv_lib_m_sin" = x""yes; then :
+  LIBS="$LIBS -lm"
+else
+
+        # Use the default compile-only tests in GCC_TRY_COMPILE_OR_LINK
+        gcc_no_link=yes
 
-      LIBS="$LIBS -lm"
+fi
+
+    fi
 
+    # Check for the existence of <math.h> functions used if C99 is enabled.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <math.h> for C++98" >&5
+$as_echo_n "checking for ISO C99 support in <math.h> for C++98... " >&6; }
+    if test "${glibcxx_cv_c99_math_cxx98+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
 
-      # Use the default compile-only tests in GCC_TRY_COMPILE_OR_LINK
-      gcc_no_link=yes
+      if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+         volatile double d1, d2;
+         volatile int i;
+int
+main ()
+{
+i = fpclassify(d1);
+         i = isfinite(d1);
+         i = isinf(d1);
+         i = isnan(d1);
+         i = isnormal(d1);
+         i = signbit(d1);
+         i = isgreater(d1, d2);
+         i = isgreaterequal(d1, d2);
+         i = isless(d1, d2);
+         i = islessequal(d1, d2);
+         i = islessgreater(d1, d2);
+         i = islessgreater(d1, d2);
+         i = isunordered(d1, d2);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_c99_math_cxx98=yes
+else
+  glibcxx_cv_c99_math_cxx98=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+         volatile double d1, d2;
+         volatile int i;
+int
+main ()
+{
+i = fpclassify(d1);
+         i = isfinite(d1);
+         i = isinf(d1);
+         i = isnan(d1);
+         i = isnormal(d1);
+         i = signbit(d1);
+         i = isgreater(d1, d2);
+         i = isgreaterequal(d1, d2);
+         i = isless(d1, d2);
+         i = islessequal(d1, d2);
+         i = islessgreater(d1, d2);
+         i = islessgreater(d1, d2);
+         i = isunordered(d1, d2);
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_c99_math_cxx98=yes
+else
+  glibcxx_cv_c99_math_cxx98=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
 
-  fi
+fi
 
-  # Check for the existence of <math.h> functions used if C99 is enabled.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <math.h>" >&5
-$as_echo_n "checking for ISO C99 support in <math.h>... " >&6; }
-  if test "${glibcxx_cv_c99_math+set}" = set; then :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_math_cxx98" >&5
+$as_echo "$glibcxx_cv_c99_math_cxx98" >&6; }
+    if test x"$glibcxx_cv_c99_math_cxx98" = x"yes"; then
+
+$as_echo "#define _GLIBCXX98_USE_C99_MATH 1" >>confdefs.h
+
+    fi
+
+    # Check for the existence of <complex.h> complex math functions.
+    # This is necessary even though libstdc++ uses the builtin versions
+    # of these functions, because if the builtin cannot be used, a reference
+    # to the library function is emitted.
+    for ac_header in tgmath.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "tgmath.h" "ac_cv_header_tgmath_h" "$ac_includes_default"
+if test "x$ac_cv_header_tgmath_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_TGMATH_H 1
+_ACEOF
+ ac_has_tgmath_h=yes
+else
+  ac_has_tgmath_h=no
+fi
+
+done
+
+    for ac_header in complex.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "complex.h" "ac_cv_header_complex_h" "$ac_includes_default"
+if test "x$ac_cv_header_complex_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_COMPLEX_H 1
+_ACEOF
+ ac_has_complex_h=yes
+else
+  ac_has_complex_h=no
+fi
+
+done
+
+    if test x"$ac_has_complex_h" = x"yes"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <complex.h> for C++98" >&5
+$as_echo_n "checking for ISO C99 support in <complex.h> for C++98... " >&6; }
+      if test "${glibcxx_cv_c99_complex_cxx98+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
 
+        if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <complex.h>
+           typedef __complex__ float float_type;
+           typedef __complex__ double double_type;
+           typedef __complex__ long double ld_type;
+           volatile float_type tmpf;
+           volatile double_type tmpd;
+           volatile ld_type tmpld;
+           volatile float f;
+           volatile double d;
+           volatile long double ld;
+int
+main ()
+{
+f = cabsf(tmpf);
+           f = cargf(tmpf);
+           tmpf = ccosf(tmpf);
+           tmpf = ccoshf(tmpf);
+           tmpf = cexpf(tmpf);
+           tmpf = clogf(tmpf);
+           tmpf = csinf(tmpf);
+           tmpf = csinhf(tmpf);
+           tmpf = csqrtf(tmpf);
+           tmpf = ctanf(tmpf);
+           tmpf = ctanhf(tmpf);
+           tmpf = cpowf(tmpf, tmpf);
+           tmpf = cprojf(tmpf);
+           d = cabs(tmpd);
+           d = carg(tmpd);
+           tmpd = ccos(tmpd);
+           tmpd = ccosh(tmpd);
+           tmpd = cexp(tmpd);
+           tmpd = clog(tmpd);
+           tmpd = csin(tmpd);
+           tmpd = csinh(tmpd);
+           tmpd = csqrt(tmpd);
+           tmpd = ctan(tmpd);
+           tmpd = ctanh(tmpd);
+           tmpd = cpow(tmpd, tmpd);
+           tmpd = cproj(tmpd);
+           ld = cabsl(tmpld);
+           ld = cargl(tmpld);
+           tmpld = ccosl(tmpld);
+           tmpld = ccoshl(tmpld);
+           tmpld = cexpl(tmpld);
+           tmpld = clogl(tmpld);
+           tmpld = csinl(tmpld);
+           tmpld = csinhl(tmpld);
+           tmpld = csqrtl(tmpld);
+           tmpld = ctanl(tmpld);
+           tmpld = ctanhl(tmpld);
+           tmpld = cpowl(tmpld, tmpld);
+           tmpld = cprojl(tmpld);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_c99_complex_cxx98=yes
+else
+  glibcxx_cv_c99_complex_cxx98=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
   if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <complex.h>
+           typedef __complex__ float float_type;
+           typedef __complex__ double double_type;
+           typedef __complex__ long double ld_type;
+           volatile float_type tmpf;
+           volatile double_type tmpd;
+           volatile ld_type tmpld;
+           volatile float f;
+           volatile double d;
+           volatile long double ld;
+int
+main ()
+{
+f = cabsf(tmpf);
+           f = cargf(tmpf);
+           tmpf = ccosf(tmpf);
+           tmpf = ccoshf(tmpf);
+           tmpf = cexpf(tmpf);
+           tmpf = clogf(tmpf);
+           tmpf = csinf(tmpf);
+           tmpf = csinhf(tmpf);
+           tmpf = csqrtf(tmpf);
+           tmpf = ctanf(tmpf);
+           tmpf = ctanhf(tmpf);
+           tmpf = cpowf(tmpf, tmpf);
+           tmpf = cprojf(tmpf);
+           d = cabs(tmpd);
+           d = carg(tmpd);
+           tmpd = ccos(tmpd);
+           tmpd = ccosh(tmpd);
+           tmpd = cexp(tmpd);
+           tmpd = clog(tmpd);
+           tmpd = csin(tmpd);
+           tmpd = csinh(tmpd);
+           tmpd = csqrt(tmpd);
+           tmpd = ctan(tmpd);
+           tmpd = ctanh(tmpd);
+           tmpd = cpow(tmpd, tmpd);
+           tmpd = cproj(tmpd);
+           ld = cabsl(tmpld);
+           ld = cargl(tmpld);
+           tmpld = ccosl(tmpld);
+           tmpld = ccoshl(tmpld);
+           tmpld = cexpl(tmpld);
+           tmpld = clogl(tmpld);
+           tmpld = csinl(tmpld);
+           tmpld = csinhl(tmpld);
+           tmpld = csqrtl(tmpld);
+           tmpld = ctanl(tmpld);
+           tmpld = ctanhl(tmpld);
+           tmpld = cpowl(tmpld, tmpld);
+           tmpld = cprojl(tmpld);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_c99_complex_cxx98=yes
+else
+  glibcxx_cv_c99_complex_cxx98=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_complex_cxx98" >&5
+$as_echo "$glibcxx_cv_c99_complex_cxx98" >&6; }
+    if test x"$glibcxx_cv_c99_complex_cxx98" = x"yes"; then
+
+$as_echo "#define _GLIBCXX98_USE_C99_COMPLEX 1" >>confdefs.h
+
+    fi
+
+    # Check for the existence in <stdio.h> of vscanf, et. al.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <stdio.h> for C++98" >&5
+$as_echo_n "checking for ISO C99 support in <stdio.h> for C++98... " >&6; }
+    if test "${glibcxx_cv_c99_stdio_cxx98+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+         #include <stdarg.h>
+         void foo(char* fmt, ...)
+         {
+           va_list args; va_start(args, fmt);
+           vfscanf(stderr, "%i", args);
+           vscanf("%i", args);
+           vsnprintf(fmt, 0, "%i", args);
+           vsscanf(fmt, "%i", args);
+           snprintf(fmt, 0, "%i");
+         }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_c99_stdio_cxx98=yes
+else
+  glibcxx_cv_c99_stdio_cxx98=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+         #include <stdarg.h>
+         void foo(char* fmt, ...)
+         {
+           va_list args; va_start(args, fmt);
+           vfscanf(stderr, "%i", args);
+           vscanf("%i", args);
+           vsnprintf(fmt, 0, "%i", args);
+           vsscanf(fmt, "%i", args);
+           snprintf(fmt, 0, "%i");
+         }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  glibcxx_cv_c99_stdio_cxx98=yes
+else
+  glibcxx_cv_c99_stdio_cxx98=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_stdio_cxx98" >&5
+$as_echo "$glibcxx_cv_c99_stdio_cxx98" >&6; }
+    if test x"$glibcxx_cv_c99_stdio_cxx98" = x"yes"; then
+
+$as_echo "#define _GLIBCXX98_USE_C99_STDIO 1" >>confdefs.h
+
+    fi
+
+    # Check for the existence in <wchar.h> of wcstold, etc.
+    if test x"$ac_has_wchar_h" = xyes &&
+       test x"$ac_has_wctype_h" = xyes; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <wchar.h> for C++98" >&5
+$as_echo_n "checking for ISO C99 support in <wchar.h> for C++98... " >&6; }
+      if test "${glibcxx_cv_c99_wchar_cxx98+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <wchar.h>
+          namespace test
+          {
+            using ::wcstold;
+            using ::wcstoll;
+            using ::wcstoull;
+          }
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_c99_wchar_cxx98=yes
+else
+  glibcxx_cv_c99_wchar_cxx98=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+
+      # Checks for wide character functions that may not be present.
+      # Injection of these is wrapped with guard macros.
+      # NB: only put functions here, instead of immediately above, if
+      # absolutely necessary.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <wchar.h>
+        namespace test { using ::vfwscanf; }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_VFWSCANF 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <wchar.h>
+        namespace test { using ::vswscanf; }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_VSWSCANF 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <wchar.h>
+        namespace test { using ::vwscanf; }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_VWSCANF 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <wchar.h>
+        namespace test { using ::wcstof; }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_WCSTOF 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <wctype.h>
+int
+main ()
+{
+wint_t t; int i = iswblank(t);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_ISWBLANK 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_wchar_cxx98" >&5
+$as_echo "$glibcxx_cv_c99_wchar_cxx98" >&6; }
+      if test x"$glibcxx_cv_c99_wchar_cxx98" = x"yes"; then
+
+$as_echo "#define _GLIBCXX98_USE_C99_WCHAR 1" >>confdefs.h
+
+      fi
+    fi
+
+    # Option parsed, now set things appropriately.
+    if test x"$glibcxx_cv_c99_math_cxx98" = x"no" ||
+       test x"$glibcxx_cv_c99_complex_cxx98" = x"no" ||
+       test x"$glibcxx_cv_c99_stdio_cxx98" = x"no" ||
+       test x"$glibcxx_cv_c99_stdlib_cxx98" = x"no" ||
+       test x"$glibcxx_cv_c99_wchar_cxx98" = x"no"; then
+      enable_c99=no;
+    else
+
+$as_echo "#define _GLIBCXX_USE_C99 1" >>confdefs.h
+
+    fi
+
+    gcc_no_link="$ac_save_gcc_no_link"
+    LIBS="$ac_save_LIBS"
+    CXXFLAGS="$ac_save_CXXFLAGS"
+    ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+    # Use -std=c++11 and test again for C99 library feature in C++11 mode.
+    # For the reasons given above we use -std=c++11 not -std=gnu++11.
+    ac_save_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="$CXXFLAGS -std=c++11"
+    ac_save_LIBS="$LIBS"
+    ac_save_gcc_no_link="$gcc_no_link"
+
+    if test x$gcc_no_link != xyes; then
+      # Use -fno-exceptions to that the C driver can link these tests without
+      # hitting undefined references to personality routines.
+      CXXFLAGS="$CXXFLAGS -fno-exceptions"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5
+$as_echo_n "checking for sin in -lm... " >&6; }
+if test "${ac_cv_lib_m_sin+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sin ();
+int
+main ()
+{
+return sin ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  ac_cv_lib_m_sin=yes
+else
+  ac_cv_lib_m_sin=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5
+$as_echo "$ac_cv_lib_m_sin" >&6; }
+if test "x$ac_cv_lib_m_sin" = x""yes; then :
+  LIBS="$LIBS -lm"
+else
+
+        # Use the default compile-only tests in GCC_TRY_COMPILE_OR_LINK
+        gcc_no_link=yes
+
+fi
+
+    fi
+
+    # Check for the existence of <math.h> functions used if C99 is enabled.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <math.h> for C++11" >&5
+$as_echo_n "checking for ISO C99 support in <math.h> for C++11... " >&6; }
+    if test "${glibcxx_cv_c99_math_cxx11+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      if test x$gcc_no_link = xyes; then
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <math.h>
-      volatile double d1, d2;
-      volatile int i;
+         volatile double d1, d2;
+         volatile int i;
 int
 main ()
 {
 i = fpclassify(d1);
-      i = isfinite(d1);
-      i = isinf(d1);
-      i = isnan(d1);
-      i = isnormal(d1);
-      i = signbit(d1);
-      i = isgreater(d1, d2);
-      i = isgreaterequal(d1, d2);
-      i = isless(d1, d2);
-      i = islessequal(d1, d2);
-      i = islessgreater(d1, d2);
-      i = islessgreater(d1, d2);
-      i = isunordered(d1, d2);
+         i = isfinite(d1);
+         i = isinf(d1);
+         i = isnan(d1);
+         i = isnormal(d1);
+         i = signbit(d1);
+         i = isgreater(d1, d2);
+         i = isgreaterequal(d1, d2);
+         i = isless(d1, d2);
+         i = islessequal(d1, d2);
+         i = islessgreater(d1, d2);
+         i = islessgreater(d1, d2);
+         i = isunordered(d1, d2);
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
-  glibcxx_cv_c99_math=yes
+  glibcxx_cv_c99_math_cxx11=yes
 else
-  glibcxx_cv_c99_math=no
+  glibcxx_cv_c99_math_cxx11=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <math.h>
-      volatile double d1, d2;
-      volatile int i;
+         volatile double d1, d2;
+         volatile int i;
 int
 main ()
 {
 i = fpclassify(d1);
-      i = isfinite(d1);
-      i = isinf(d1);
-      i = isnan(d1);
-      i = isnormal(d1);
-      i = signbit(d1);
-      i = isgreater(d1, d2);
-      i = isgreaterequal(d1, d2);
-      i = isless(d1, d2);
-      i = islessequal(d1, d2);
-      i = islessgreater(d1, d2);
-      i = islessgreater(d1, d2);
-      i = isunordered(d1, d2);
+         i = isfinite(d1);
+         i = isinf(d1);
+         i = isnan(d1);
+         i = isnormal(d1);
+         i = signbit(d1);
+         i = isgreater(d1, d2);
+         i = isgreaterequal(d1, d2);
+         i = isless(d1, d2);
+         i = islessequal(d1, d2);
+         i = islessgreater(d1, d2);
+         i = islessgreater(d1, d2);
+         i = isunordered(d1, d2);
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_cxx_try_link "$LINENO"; then :
-  glibcxx_cv_c99_math=yes
+  glibcxx_cv_c99_math_cxx11=yes
 else
-  glibcxx_cv_c99_math=no
+  glibcxx_cv_c99_math_cxx11=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
 fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_math" >&5
-$as_echo "$glibcxx_cv_c99_math" >&6; }
-  if test x"$glibcxx_cv_c99_math" = x"yes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_math_cxx11" >&5
+$as_echo "$glibcxx_cv_c99_math_cxx11" >&6; }
+    if test x"$glibcxx_cv_c99_math_cxx11" = x"yes"; then
 
-$as_echo "#define _GLIBCXX_USE_C99_MATH 1" >>confdefs.h
+$as_echo "#define _GLIBCXX11_USE_C99_MATH 1" >>confdefs.h
 
-  fi
+    fi
 
-  # Check for the existence of <complex.h> complex math functions.
-  # This is necessary even though libstdc++ uses the builtin versions
-  # of these functions, because if the builtin cannot be used, a reference
-  # to the library function is emitted.
-  for ac_header in tgmath.h
+    # Check for the existence of <complex.h> complex math functions.
+    # This is necessary even though libstdc++ uses the builtin versions
+    # of these functions, because if the builtin cannot be used, a reference
+    # to the library function is emitted.
+    for ac_header in tgmath.h
 do :
   ac_fn_cxx_check_header_mongrel "$LINENO" "tgmath.h" "ac_cv_header_tgmath_h" "$ac_includes_default"
 if test "x$ac_cv_header_tgmath_h" = x""yes; then :
@@ -16723,7 +17310,7 @@ fi
 
 done
 
-  for ac_header in complex.h
+    for ac_header in complex.h
 do :
   ac_fn_cxx_check_header_mongrel "$LINENO" "complex.h" "ac_cv_header_complex_h" "$ac_includes_default"
 if test "x$ac_cv_header_complex_h" = x""yes; then :
 
 done
 
-  glibcxx_cv_c99_complex=no;
-  if test x"$ac_has_complex_h" = x"yes"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <complex.h>" >&5
-$as_echo_n "checking for ISO C99 support in <complex.h>... " >&6; }
-    if test x$gcc_no_link = xyes; then
+    if test x"$ac_has_complex_h" = x"yes"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <complex.h> for C++11" >&5
+$as_echo_n "checking for ISO C99 support in <complex.h> for C++11... " >&6; }
+      if test "${glibcxx_cv_c99_complex_cxx11+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+        if test x$gcc_no_link = xyes; then
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <complex.h>
-       typedef __complex__ float float_type;
-       typedef __complex__ double double_type;
-       typedef __complex__ long double ld_type;
-       volatile float_type tmpf;
-       volatile double_type tmpd;
-       volatile ld_type tmpld;
-       volatile float f;
-       volatile double d;
-       volatile long double ld;
+           typedef __complex__ float float_type;
+           typedef __complex__ double double_type;
+           typedef __complex__ long double ld_type;
+           volatile float_type tmpf;
+           volatile double_type tmpd;
+           volatile ld_type tmpld;
+           volatile float f;
+           volatile double d;
+           volatile long double ld;
 int
 main ()
 {
 f = cabsf(tmpf);
-       f = cargf(tmpf);
-       tmpf = ccosf(tmpf);
-       tmpf = ccoshf(tmpf);
-       tmpf = cexpf(tmpf);
-       tmpf = clogf(tmpf);
-       tmpf = csinf(tmpf);
-       tmpf = csinhf(tmpf);
-       tmpf = csqrtf(tmpf);
-       tmpf = ctanf(tmpf);
-       tmpf = ctanhf(tmpf);
-       tmpf = cpowf(tmpf, tmpf);
-       tmpf = cprojf(tmpf);
-       d = cabs(tmpd);
-       d = carg(tmpd);
-       tmpd = ccos(tmpd);
-       tmpd = ccosh(tmpd);
-       tmpd = cexp(tmpd);
-       tmpd = clog(tmpd);
-       tmpd = csin(tmpd);
-       tmpd = csinh(tmpd);
-       tmpd = csqrt(tmpd);
-       tmpd = ctan(tmpd);
-       tmpd = ctanh(tmpd);
-       tmpd = cpow(tmpd, tmpd);
-       tmpd = cproj(tmpd);
-       ld = cabsl(tmpld);
-       ld = cargl(tmpld);
-       tmpld = ccosl(tmpld);
-       tmpld = ccoshl(tmpld);
-       tmpld = cexpl(tmpld);
-       tmpld = clogl(tmpld);
-       tmpld = csinl(tmpld);
-       tmpld = csinhl(tmpld);
-       tmpld = csqrtl(tmpld);
-       tmpld = ctanl(tmpld);
-       tmpld = ctanhl(tmpld);
-       tmpld = cpowl(tmpld, tmpld);
-       tmpld = cprojl(tmpld);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  glibcxx_cv_c99_complex=yes
-else
-  glibcxx_cv_c99_complex=no
+           f = cargf(tmpf);
+           tmpf = ccosf(tmpf);
+           tmpf = ccoshf(tmpf);
+           tmpf = cexpf(tmpf);
+           tmpf = clogf(tmpf);
+           tmpf = csinf(tmpf);
+           tmpf = csinhf(tmpf);
+           tmpf = csqrtf(tmpf);
+           tmpf = ctanf(tmpf);
+           tmpf = ctanhf(tmpf);
+           tmpf = cpowf(tmpf, tmpf);
+           tmpf = cprojf(tmpf);
+           d = cabs(tmpd);
+           d = carg(tmpd);
+           tmpd = ccos(tmpd);
+           tmpd = ccosh(tmpd);
+           tmpd = cexp(tmpd);
+           tmpd = clog(tmpd);
+           tmpd = csin(tmpd);
+           tmpd = csinh(tmpd);
+           tmpd = csqrt(tmpd);
+           tmpd = ctan(tmpd);
+           tmpd = ctanh(tmpd);
+           tmpd = cpow(tmpd, tmpd);
+           tmpd = cproj(tmpd);
+           ld = cabsl(tmpld);
+           ld = cargl(tmpld);
+           tmpld = ccosl(tmpld);
+           tmpld = ccoshl(tmpld);
+           tmpld = cexpl(tmpld);
+           tmpld = clogl(tmpld);
+           tmpld = csinl(tmpld);
+           tmpld = csinhl(tmpld);
+           tmpld = csqrtl(tmpld);
+           tmpld = ctanl(tmpld);
+           tmpld = ctanhl(tmpld);
+           tmpld = cpowl(tmpld, tmpld);
+           tmpld = cprojl(tmpld);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  glibcxx_cv_c99_complex_cxx11=yes
+else
+  glibcxx_cv_c99_complex_cxx11=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <complex.h>
-       typedef __complex__ float float_type;
-       typedef __complex__ double double_type;
-       typedef __complex__ long double ld_type;
-       volatile float_type tmpf;
-       volatile double_type tmpd;
-       volatile ld_type tmpld;
-       volatile float f;
-       volatile double d;
-       volatile long double ld;
+           typedef __complex__ float float_type;
+           typedef __complex__ double double_type;
+           typedef __complex__ long double ld_type;
+           volatile float_type tmpf;
+           volatile double_type tmpd;
+           volatile ld_type tmpld;
+           volatile float f;
+           volatile double d;
+           volatile long double ld;
 int
 main ()
 {
 f = cabsf(tmpf);
-       f = cargf(tmpf);
-       tmpf = ccosf(tmpf);
-       tmpf = ccoshf(tmpf);
-       tmpf = cexpf(tmpf);
-       tmpf = clogf(tmpf);
-       tmpf = csinf(tmpf);
-       tmpf = csinhf(tmpf);
-       tmpf = csqrtf(tmpf);
-       tmpf = ctanf(tmpf);
-       tmpf = ctanhf(tmpf);
-       tmpf = cpowf(tmpf, tmpf);
-       tmpf = cprojf(tmpf);
-       d = cabs(tmpd);
-       d = carg(tmpd);
-       tmpd = ccos(tmpd);
-       tmpd = ccosh(tmpd);
-       tmpd = cexp(tmpd);
-       tmpd = clog(tmpd);
-       tmpd = csin(tmpd);
-       tmpd = csinh(tmpd);
-       tmpd = csqrt(tmpd);
-       tmpd = ctan(tmpd);
-       tmpd = ctanh(tmpd);
-       tmpd = cpow(tmpd, tmpd);
-       tmpd = cproj(tmpd);
-       ld = cabsl(tmpld);
-       ld = cargl(tmpld);
-       tmpld = ccosl(tmpld);
-       tmpld = ccoshl(tmpld);
-       tmpld = cexpl(tmpld);
-       tmpld = clogl(tmpld);
-       tmpld = csinl(tmpld);
-       tmpld = csinhl(tmpld);
-       tmpld = csqrtl(tmpld);
-       tmpld = ctanl(tmpld);
-       tmpld = ctanhl(tmpld);
-       tmpld = cpowl(tmpld, tmpld);
-       tmpld = cprojl(tmpld);
+           f = cargf(tmpf);
+           tmpf = ccosf(tmpf);
+           tmpf = ccoshf(tmpf);
+           tmpf = cexpf(tmpf);
+           tmpf = clogf(tmpf);
+           tmpf = csinf(tmpf);
+           tmpf = csinhf(tmpf);
+           tmpf = csqrtf(tmpf);
+           tmpf = ctanf(tmpf);
+           tmpf = ctanhf(tmpf);
+           tmpf = cpowf(tmpf, tmpf);
+           tmpf = cprojf(tmpf);
+           d = cabs(tmpd);
+           d = carg(tmpd);
+           tmpd = ccos(tmpd);
+           tmpd = ccosh(tmpd);
+           tmpd = cexp(tmpd);
+           tmpd = clog(tmpd);
+           tmpd = csin(tmpd);
+           tmpd = csinh(tmpd);
+           tmpd = csqrt(tmpd);
+           tmpd = ctan(tmpd);
+           tmpd = ctanh(tmpd);
+           tmpd = cpow(tmpd, tmpd);
+           tmpd = cproj(tmpd);
+           ld = cabsl(tmpld);
+           ld = cargl(tmpld);
+           tmpld = ccosl(tmpld);
+           tmpld = ccoshl(tmpld);
+           tmpld = cexpl(tmpld);
+           tmpld = clogl(tmpld);
+           tmpld = csinl(tmpld);
+           tmpld = csinhl(tmpld);
+           tmpld = csqrtl(tmpld);
+           tmpld = ctanl(tmpld);
+           tmpld = ctanhl(tmpld);
+           tmpld = cpowl(tmpld, tmpld);
+           tmpld = cprojl(tmpld);
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_cxx_try_link "$LINENO"; then :
-  glibcxx_cv_c99_complex=yes
+  glibcxx_cv_c99_complex_cxx11=yes
 else
-  glibcxx_cv_c99_complex=no
+  glibcxx_cv_c99_complex_cxx11=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 fi
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_complex" >&5
-$as_echo "$glibcxx_cv_c99_complex" >&6; }
-  if test x"$glibcxx_cv_c99_complex" = x"yes"; then
 
-$as_echo "#define _GLIBCXX_USE_C99_COMPLEX 1" >>confdefs.h
+fi
 
-  fi
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_complex_cxx11" >&5
+$as_echo "$glibcxx_cv_c99_complex_cxx11" >&6; }
+    if test x"$glibcxx_cv_c99_complex_cxx11" = x"yes"; then
+
+$as_echo "#define _GLIBCXX11_USE_C99_COMPLEX 1" >>confdefs.h
 
-  # Check for the existence in <stdio.h> of vscanf, et. al.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <stdio.h>" >&5
-$as_echo_n "checking for ISO C99 support in <stdio.h>... " >&6; }
-  if test "${glibcxx_cv_c99_stdio+set}" = set; then :
+    fi
+
+    # Check for the existence in <stdio.h> of vscanf, et. al.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <stdio.h> for C++11" >&5
+$as_echo_n "checking for ISO C99 support in <stdio.h> for C++11... " >&6; }
+    if test "${glibcxx_cv_c99_stdio_cxx11+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
 
-  if test x$gcc_no_link = xyes; then
+      if test x$gcc_no_link = xyes; then
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
-      #include <stdarg.h>
-      void foo(char* fmt, ...)
-      {
-       va_list args; va_start(args, fmt);
-       vfscanf(stderr, "%i", args);
-       vscanf("%i", args);
-       vsnprintf(fmt, 0, "%i", args);
-       vsscanf(fmt, "%i", args);
-       snprintf(fmt, 0, "%i");
-      }
+         #include <stdarg.h>
+         void foo(char* fmt, ...)
+         {
+           va_list args; va_start(args, fmt);
+           vfscanf(stderr, "%i", args);
+           vscanf("%i", args);
+           vsnprintf(fmt, 0, "%i", args);
+           vsscanf(fmt, "%i", args);
+           snprintf(fmt, 0, "%i");
+         }
 int
 main ()
 {
@@ -16917,9 +17510,9 @@ main ()
 }
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
-  glibcxx_cv_c99_stdio=yes
+  glibcxx_cv_c99_stdio_cxx11=yes
 else
-  glibcxx_cv_c99_stdio=no
+  glibcxx_cv_c99_stdio_cxx11=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
-      #include <stdarg.h>
-      void foo(char* fmt, ...)
-      {
-       va_list args; va_start(args, fmt);
-       vfscanf(stderr, "%i", args);
-       vscanf("%i", args);
-       vsnprintf(fmt, 0, "%i", args);
-       vsscanf(fmt, "%i", args);
-       snprintf(fmt, 0, "%i");
-      }
+         #include <stdarg.h>
+         void foo(char* fmt, ...)
+         {
+           va_list args; va_start(args, fmt);
+           vfscanf(stderr, "%i", args);
+           vscanf("%i", args);
+           vsnprintf(fmt, 0, "%i", args);
+           vsscanf(fmt, "%i", args);
+           snprintf(fmt, 0, "%i");
+         }
 int
 main ()
 {
@@ -16948,9 +17541,9 @@ main ()
 }
 _ACEOF
 if ac_fn_cxx_try_link "$LINENO"; then :
-  glibcxx_cv_c99_stdio=yes
+  glibcxx_cv_c99_stdio_cxx11=yes
 else
-  glibcxx_cv_c99_stdio=no
+  glibcxx_cv_c99_stdio_cxx11=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
 fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_stdio" >&5
-$as_echo "$glibcxx_cv_c99_stdio" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_stdio_cxx11" >&5
+$as_echo "$glibcxx_cv_c99_stdio_cxx11" >&6; }
+    if test x"$glibcxx_cv_c99_stdio_cxx11" = x"yes"; then
+
+$as_echo "#define _GLIBCXX11_USE_C99_STDIO 1" >>confdefs.h
 
-  # Check for the existence in <stdlib.h> of lldiv_t, et. al.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <stdlib.h>" >&5
-$as_echo_n "checking for ISO C99 support in <stdlib.h>... " >&6; }
-  if test "${glibcxx_cv_c99_stdlib+set}" = set; then :
+    fi
+
+    # Check for the existence in <stdlib.h> of lldiv_t, et. al.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <stdlib.h> for C++11" >&5
+$as_echo_n "checking for ISO C99 support in <stdlib.h> for C++11... " >&6; }
+    if test "${glibcxx_cv_c99_stdlib_cxx11+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
 
-  if test x$gcc_no_link = xyes; then
+      if test x$gcc_no_link = xyes; then
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
-      volatile float f;
-      volatile long double ld;
-      volatile unsigned long long ll;
-      lldiv_t mydivt;
+         volatile float f;
+         volatile long double ld;
+         volatile unsigned long long ll;
+         lldiv_t mydivt;
 int
 main ()
 {
 char* tmp;
-      f = strtof("gnu", &tmp);
-      ld = strtold("gnu", &tmp);
-      ll = strtoll("gnu", &tmp, 10);
-      ll = strtoull("gnu", &tmp, 10);
-      ll = llabs(10);
-      mydivt = lldiv(10,1);
-      ll = mydivt.quot;
-      ll = mydivt.rem;
-      ll = atoll("10");
-      _Exit(0);
+         f = strtof("gnu", &tmp);
+         ld = strtold("gnu", &tmp);
+         ll = strtoll("gnu", &tmp, 10);
+         ll = strtoull("gnu", &tmp, 10);
+         ll = llabs(10);
+         mydivt = lldiv(10,1);
+         ll = mydivt.quot;
+         ll = mydivt.rem;
+         ll = atoll("10");
+         _Exit(0);
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
-  glibcxx_cv_c99_stdlib=yes
+  glibcxx_cv_c99_stdlib_cxx11=yes
 else
-  glibcxx_cv_c99_stdlib=no
+  glibcxx_cv_c99_stdlib_cxx11=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
-      volatile float f;
-      volatile long double ld;
-      volatile unsigned long long ll;
-      lldiv_t mydivt;
+         volatile float f;
+         volatile long double ld;
+         volatile unsigned long long ll;
+         lldiv_t mydivt;
 int
 main ()
 {
 char* tmp;
-      f = strtof("gnu", &tmp);
-      ld = strtold("gnu", &tmp);
-      ll = strtoll("gnu", &tmp, 10);
-      ll = strtoull("gnu", &tmp, 10);
-      ll = llabs(10);
-      mydivt = lldiv(10,1);
-      ll = mydivt.quot;
-      ll = mydivt.rem;
-      ll = atoll("10");
-      _Exit(0);
+         f = strtof("gnu", &tmp);
+         ld = strtold("gnu", &tmp);
+         ll = strtoll("gnu", &tmp, 10);
+         ll = strtoull("gnu", &tmp, 10);
+         ll = llabs(10);
+         mydivt = lldiv(10,1);
+         ll = mydivt.quot;
+         ll = mydivt.rem;
+         ll = atoll("10");
+         _Exit(0);
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_cxx_try_link "$LINENO"; then :
-  glibcxx_cv_c99_stdlib=yes
+  glibcxx_cv_c99_stdlib_cxx11=yes
 else
-  glibcxx_cv_c99_stdlib=no
+  glibcxx_cv_c99_stdlib_cxx11=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
 fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_stdlib" >&5
-$as_echo "$glibcxx_cv_c99_stdlib" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_stdlib_cxx11" >&5
+$as_echo "$glibcxx_cv_c99_stdlib_cxx11" >&6; }
+    if test x"$glibcxx_cv_c99_stdlib_cxx11" = x"yes"; then
 
-  # Check for the existence in <wchar.h> of wcstold, etc.
-  glibcxx_cv_c99_wchar=no;
-  if test x"$ac_has_wchar_h" = xyes &&
-     test x"$ac_has_wctype_h" = xyes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <wchar.h>" >&5
-$as_echo_n "checking for ISO C99 support in <wchar.h>... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+$as_echo "#define _GLIBCXX11_USE_C99_STDLIB 1" >>confdefs.h
+
+    fi
+
+    # Check for the existence in <wchar.h> of wcstold, etc.
+    if test x"$ac_has_wchar_h" = xyes &&
+       test x"$ac_has_wctype_h" = xyes; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ISO C99 support in <wchar.h> for C++11" >&5
+$as_echo_n "checking for ISO C99 support in <wchar.h> for C++11... " >&6; }
+      if test "${glibcxx_cv_c99_wchar_cxx11+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <wchar.h>
-                   namespace test
-                   {
-                     using ::wcstold;
-                     using ::wcstoll;
-                     using ::wcstoull;
-                   }
+          namespace test
+          {
+            using ::wcstold;
+            using ::wcstoll;
+            using ::wcstoull;
+          }
 
 int
 main ()
@@ -17070,20 +17676,23 @@ main ()
 }
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
-  glibcxx_cv_c99_wchar=yes
+  glibcxx_cv_c99_wchar_cxx11=yes
 else
-  glibcxx_cv_c99_wchar=no
+  glibcxx_cv_c99_wchar_cxx11=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    # Checks for wide character functions that may not be present.
-    # Injection of these is wrapped with guard macros.
-    # NB: only put functions here, instead of immediately above, if
-    # absolutely necessary.
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+fi
+
+
+      # Checks for wide character functions that may not be present.
+      # Injection of these is wrapped with guard macros.
+      # NB: only put functions here, instead of immediately above, if
+      # absolutely necessary.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <wchar.h>
-                   namespace test { using ::vfwscanf; }
+        namespace test { using ::vfwscanf; }
 int
 main ()
 {
@@ -17099,10 +17708,10 @@ $as_echo "#define HAVE_VFWSCANF 1" >>confdefs.h
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <wchar.h>
-                   namespace test { using ::vswscanf; }
+        namespace test { using ::vswscanf; }
 int
 main ()
 {
@@ -17118,10 +17727,10 @@ $as_echo "#define HAVE_VSWSCANF 1" >>confdefs.h
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <wchar.h>
-                   namespace test { using ::vwscanf; }
+        namespace test { using ::vwscanf; }
 int
 main ()
 {
@@ -17137,10 +17746,10 @@ $as_echo "#define HAVE_VWSCANF 1" >>confdefs.h
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <wchar.h>
-                   namespace test { using ::wcstof; }
+        namespace test { using ::wcstof; }
 int
 main ()
 {
@@ -17156,13 +17765,13 @@ $as_echo "#define HAVE_WCSTOF 1" >>confdefs.h
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <wctype.h>
 int
 main ()
 {
- wint_t t; int i = iswblank(t);
+wint_t t; int i = iswblank(t);
   ;
   return 0;
 }
@@ -17174,27 +17783,19 @@ $as_echo "#define HAVE_ISWBLANK 1" >>confdefs.h
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_wchar" >&5
-$as_echo "$glibcxx_cv_c99_wchar" >&6; }
-  fi
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_c99_wchar_cxx11" >&5
+$as_echo "$glibcxx_cv_c99_wchar_cxx11" >&6; }
+      if test x"$glibcxx_cv_c99_wchar_cxx11" = x"yes"; then
 
-  # Option parsed, now set things appropriately.
-  if test x"$glibcxx_cv_c99_math" = x"no" ||
-     test x"$glibcxx_cv_c99_complex" = x"no" ||
-     test x"$glibcxx_cv_c99_stdio" = x"no" ||
-     test x"$glibcxx_cv_c99_stdlib" = x"no" ||
-     test x"$glibcxx_cv_c99_wchar" = x"no"; then
-    enable_c99=no;
-  else
+$as_echo "#define _GLIBCXX11_USE_C99_WCHAR 1" >>confdefs.h
 
-$as_echo "#define _GLIBCXX_USE_C99 1" >>confdefs.h
-
-  fi
+      fi
+    fi
 
-  gcc_no_link="$ac_save_gcc_no_link"
-  LIBS="$ac_save_LIBS"
-  CXXFLAGS="$ac_save_CXXFLAGS"
-  ac_ext=c
+    gcc_no_link="$ac_save_gcc_no_link"
+    LIBS="$ac_save_LIBS"
+    CXXFLAGS="$ac_save_CXXFLAGS"
+    ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
index 35246d945aaf9597d9441703b4ea4a1ed40649d0..b3853cd58286a7f629ca453acd5e967fd6d0a5b4 100644 (file)
@@ -5387,7 +5387,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
+#if __cplusplus >= 201103L
 
 #include <ext/string_conversions.h>
 
@@ -5396,6 +5396,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _GLIBCXX_BEGIN_NAMESPACE_CXX11
 
+#if _GLIBCXX_USE_C99_STDLIB
   // 21.4 Numeric Conversions [string.conversions].
   inline int
   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
@@ -5434,7 +5435,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
   inline long double
   stold(const string& __str, size_t* __idx = 0)
   { return __gnu_cxx::__stoa(&std::strtold, "stold", __str.c_str(), __idx); }
+#endif // _GLIBCXX_USE_C99_STDLIB
 
+#if _GLIBCXX_USE_C99_STDIO
   // NB: (v)snprintf vs sprintf.
 
   // DR 1261.
@@ -5498,8 +5501,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
     return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
                                           "%Lf", __val);
   }
+#endif // _GLIBCXX_USE_C99_STDIO
 
-#ifdef _GLIBCXX_USE_WCHAR_T
+#if defined(_GLIBCXX_USE_WCHAR_T) && defined(_GLIBCXX_USE_C99_WCHAR)
   inline int 
   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
   { return __gnu_cxx::__stoa<long, int>(&std::wcstol, "stoi", __str.c_str(),
@@ -5601,13 +5605,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
                                            L"%Lf", __val);
   }
 #endif // _GLIBCXX_HAVE_BROKEN_VSWPRINTF
-#endif
+#endif // _GLIBCXX_USE_WCHAR_T && _GLIBCXX_USE_C99_WCHAR
 
 _GLIBCXX_END_NAMESPACE_CXX11
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#endif /* C++11 && _GLIBCXX_USE_C99 ... */
+#endif /* C++11 */
 
 #if __cplusplus >= 201103L
 
index 924f13e384c81ccb59555214f5c725e9d6a89f58..723feb12ee0f11faf4193ba994abc1087f0c9209 100644 (file)
@@ -529,4 +529,40 @@ namespace std
 #undef min
 #undef max
 
+// N.B. these _GLIBCXX_USE_C99_XXX macros are defined unconditionally
+// so they should be tested with #if not with #ifdef.
+#if __cplusplus >= 201103L
+# ifndef _GLIBCXX_USE_C99_MATH
+#  define _GLIBCXX_USE_C99_MATH _GLIBCXX11_USE_C99_MATH
+# endif
+# ifndef _GLIBCXX_USE_C99_COMPLEX
+# define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX11_USE_C99_COMPLEX
+# endif
+# ifndef _GLIBCXX_USE_C99_STDIO
+# define _GLIBCXX_USE_C99_STDIO _GLIBCXX11_USE_C99_STDIO
+# endif
+# ifndef _GLIBCXX_USE_C99_STDLIB
+# define _GLIBCXX_USE_C99_STDLIB _GLIBCXX11_USE_C99_STDLIB
+# endif
+# ifndef _GLIBCXX_USE_C99_WCHAR
+# define _GLIBCXX_USE_C99_WCHAR _GLIBCXX11_USE_C99_WCHAR
+# endif
+#else
+# ifndef _GLIBCXX_USE_C99_MATH
+#  define _GLIBCXX_USE_C99_MATH _GLIBCXX98_USE_C99_MATH
+# endif
+# ifndef _GLIBCXX_USE_C99_COMPLEX
+# define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX98_USE_C99_COMPLEX
+# endif
+# ifndef _GLIBCXX_USE_C99_STDIO
+# define _GLIBCXX_USE_C99_STDIO _GLIBCXX98_USE_C99_STDIO
+# endif
+# ifndef _GLIBCXX_USE_C99_STDLIB
+# define _GLIBCXX_USE_C99_STDLIB _GLIBCXX98_USE_C99_STDLIB
+# endif
+# ifndef _GLIBCXX_USE_C99_WCHAR
+# define _GLIBCXX_USE_C99_WCHAR _GLIBCXX98_USE_C99_WCHAR
+# endif
+#endif
+
 // End of prewritten config; the settings discovered at configure time follow.
index bd58771395e8a6a90f086e105da229cc09b8903f..2db2d83a48bf98adf8948bba926a8ac1072e122b 100644 (file)
@@ -959,13 +959,13 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
     }
 
   // The following code uses vsnprintf (or vsprintf(), when
-  // _GLIBCXX_USE_C99 is not defined) to convert floating point values
-  // for insertion into a stream.  An optimization would be to replace
-  // them with code that works directly on a wide buffer and then use
-  // __pad to do the padding.  It would be good to replace them anyway
-  // to gain back the efficiency that C++ provides by knowing up front
-  // the type of the values to insert.  Also, sprintf is dangerous
-  // since may lead to accidental buffer overruns.  This
+  // _GLIBCXX_USE_C99_STDIO is not defined) to convert floating point
+  // values for insertion into a stream.  An optimization would be to
+  // replace them with code that works directly on a wide buffer and
+  // then use __pad to do the padding.  It would be good to replace
+  // them anyway to gain back the efficiency that C++ provides by
+  // knowing up front the type of the values to insert.  Also, sprintf
+  // is dangerous since may lead to accidental buffer overruns.  This
   // implementation follows the C++ standard fairly directly as
   // outlined in 22.2.2.2 [lib.locale.num.put]
   template<typename _CharT, typename _OutIter>
@@ -992,7 +992,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
        char __fbuf[16];
        __num_base::_S_format_float(__io, __fbuf, __mod);
 
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
        // Precision is always used except for hexfloat format.
        const bool __use_prec =
          (__io.flags() & ios_base::floatfield) != ios_base::floatfield;
index 2e73b5d2af051b100061d457fd35148836eca551..631ef537791e16529989e9f805c689590321d47f 100644 (file)
@@ -578,7 +578,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11
     {
       const locale __loc = __io.getloc();
       const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
       // First try a buffer perhaps big enough.
       int __cs_size = 64;
       char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
@@ -751,7 +751,7 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
                case 'S':
                  // Seconds. [tm_sec]
                  // [00, 60] in C99 (one leap-second), [00, 61] in C89.
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99
                  __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 60, 2,
 #else
                  __beg = _M_extract_num(__beg, __end, __tm->tm_sec, 0, 61, 2,
index d6acb6dea62f0b541957703f81a55eb5a1a410fa..7729896dd5ee4f90a6fcea3cc288ab98bfb799a2 100644 (file)
@@ -56,7 +56,7 @@ using std::fabs;
 using std::floor;
 using std::fmod;
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_MATH
 using std::fpclassify;
 using std::isfinite;
 using std::isinf;
index 06b5d47b6c7b83ccd9f998cf26e18cadef50ceb1..3bc12d07272dded7eb39c060a28527fee9924ba7 100644 (file)
@@ -103,7 +103,7 @@ using std::wmemmove;
 using std::wmemset;
 using std::wcsftime;
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 using std::wcstold;
 using std::wcstoll;
 using std::wcstoull;
index d1c958b6383424c785401be482cca90cb7a5ebea..486cee9905e4aa086f52049d7ea3271b1fd4dde6 100644 (file)
@@ -146,7 +146,7 @@ namespace std
   using ::vsprintf;
 } // namespace
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
 
 #undef snprintf
 #undef vfscanf
@@ -189,6 +189,6 @@ namespace std
   using ::__gnu_cxx::vsscanf;
 } // namespace std
 
-#endif // _GLIBCXX_USE_C99
+#endif // _GLIBCXX_USE_C99_STDIO
 
 #endif
index 7e9bb30f05e1ffb7b1d38f17aa3dc1c538709c4d..a2f44fc3eafc41a0709723fcb2bb52d53f01853d 100644 (file)
@@ -195,7 +195,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 
 #undef _Exit
 #undef llabs
@@ -266,7 +266,7 @@ namespace std
   using ::__gnu_cxx::strtold;
 } // namespace std
 
-#endif // _GLIBCXX_USE_C99
+#endif // _GLIBCXX_USE_C99_STDLIB
 
 #endif // !_GLIBCXX_HOSTED
 
index dddb4092bbe31b0b70f52a0d623d1066b8225511..15714633c1e5e33b1b73e22cdc8cc509abb90a8b 100644 (file)
@@ -232,7 +232,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
 #undef wcstold
 #undef wcstoll
@@ -289,7 +289,7 @@ namespace std
   using std::vwscanf;
 #endif
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
   using std::wcstold;
   using std::wcstoll;
   using std::wcstoull;
index 37f01cad70ac2d0501a52d0964ed310690e0785a..b7860f96853089e829192ccb710b65c4f2822382 100644 (file)
@@ -144,7 +144,7 @@ namespace std
   using ::vsprintf;
 } // namespace std
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
 
 #undef snprintf
 #undef vfscanf
index 0bd70589ee28db05f1ccbda9b036846cff6e9b76..7b69884f8704c95104ad77d0dec7d74b94322c82 100644 (file)
@@ -192,7 +192,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 
 #undef _Exit
 #undef llabs
@@ -263,7 +263,7 @@ namespace std
   using ::__gnu_cxx::strtold;
 } // namespace std
 
-#endif // _GLIBCXX_USE_C99
+#endif // _GLIBCXX_USE_C99_STDLIB
 
 #endif // !_GLIBCXX_HOSTED
 
index aa1b2fa024c3c33978f467e0013e407dc103e37a..5aade7f64bab5a567256df289785d20878ea235b 100644 (file)
@@ -228,7 +228,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
 #undef wcstold
 #undef wcstoll
index 68acd576528b23919ffff6e0ddaffebd63df32d0..8732bd38891a7b74a0a0f4cf8d4f804c3db7a689 100644 (file)
@@ -2680,7 +2680,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99))
+#if __cplusplus >= 201103L
 
 #include <ext/string_conversions.h>
 
@@ -2688,6 +2688,7 @@ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
+#if _GLIBCXX_USE_C99_STDLIB
   // 21.4 Numeric Conversions [string.conversions].
   inline int
   stoi(const __vstring& __str, std::size_t* __idx = 0, int __base = 10)
@@ -2726,7 +2727,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   inline long double
   stold(const __vstring& __str, std::size_t* __idx = 0)
   { return __gnu_cxx::__stoa(&std::strtold, "stold", __str.c_str(), __idx); }
+#endif // _GLIBCXX_USE_C99_STDLIB
 
+#if _GLIBCXX_USE_C99_STDIO
   // NB: (v)snprintf vs sprintf.
 
   // DR 1261.
@@ -2789,8 +2792,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     return __gnu_cxx::__to_xstring<__vstring>(&std::vsnprintf, __n,
                                              "%Lf", __val);
   }
+#endif // _GLIBCXX_USE_C99_STDIO
 
-#ifdef _GLIBCXX_USE_WCHAR_T
+#if defined(_GLIBCXX_USE_WCHAR_T) && defined(_GLIBCXX_USE_C99_WCHAR)
   inline int 
   stoi(const __wvstring& __str, std::size_t* __idx = 0, int __base = 10)
   { return __gnu_cxx::__stoa<long, int>(&std::wcstol, "stoi", __str.c_str(),
@@ -2890,8 +2894,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     return __gnu_cxx::__to_xstring<__wvstring>(&std::vswprintf, __n,
                                               L"%Lf", __val);
   }
-#endif
-#endif
+#endif // _GLIBCXX_HAVE_BROKEN_VSWPRINTF
+#endif // _GLIBCXX_USE_WCHAR_T && _GLIBCXX_USE_C99_WCHAR
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
index 5ed4fd571f13e3906a6e0bed295a690a4cecac0c..f1d3b79f504d1f2323a7ba1cf11f1c13df993531 100644 (file)
@@ -995,7 +995,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     complex<_Tp>
     pow(const complex<_Tp>& __x, const _Tp& __y)
     {
-#ifndef _GLIBCXX_USE_C99_COMPLEX
+#if ! _GLIBCXX_USE_C99_COMPLEX
       if (__x == _Tp())
        return _Tp();
 #endif
@@ -1831,7 +1831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     arg(_Tp __x)
     {
       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
-#if (_GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC)
+#if (_GLIBCXX11_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC)
       return std::signbit(__x) ? __type(3.1415926535897932384626433832795029L)
                               : __type();
 #else
index 768182300905ee28c11a4f212540d13ca4306a94..b8fc04f72c6e931d4a27eda34069ed182b704660 100644 (file)
@@ -33,7 +33,7 @@
 
 #include <cstdio>
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
index c3c65eb8fbb4876e8e8a62025964e537e9142dfb..35a91334c943afe0666ac620856360bd52a061af 100644 (file)
@@ -35,7 +35,7 @@
 
 #if _GLIBCXX_HOSTED
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
@@ -65,7 +65,7 @@ namespace tr1
 }
 }
 
-#endif // _GLIBCXX_USE_C99 
+#endif // _GLIBCXX_USE_C99_STDLIB
 
 #endif // _GLIBCXX_HOSTED
 
index 10772ee278a032d2c7e13fc5bc45b80ba098bc8b..0db2262f7b1513f1a1ddccdb604d0a3a9303a6f1 100644 (file)
@@ -52,7 +52,7 @@ namespace tr1
   using std::vwscanf;
 #endif
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
   using std::wcstold;
   using std::wcstoll;
   using std::wcstoull;
index 310c7bc67a6de5b820d25cde110d442b6a36925b..5e826d6270a193cb5d4cb838faf1a8237f4831f8 100644 (file)
@@ -33,7 +33,7 @@
 
 #if _GLIBCXX_HOSTED
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 
 using std::tr1::atoll;
 using std::tr1::strtoll;
index 071f79ebbaeb1b7d98952461d6a7d787f20fdfa3..28b6f3aabb7f62168167f1befa39ec15a35ba2fe 100644 (file)
@@ -72,7 +72,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
     ios_base::fmtflags __fltfield = __flags & ios_base::floatfield;
 
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
     // Precision is always used except for hexfloat format.
     if (__fltfield != (ios_base::fixed | ios_base::scientific))
 #endif
@@ -89,7 +89,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       *__fptr++ = 'f';
     else if (__fltfield == ios_base::scientific)
       *__fptr++ = (__flags & ios_base::uppercase) ? 'E' : 'e';
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
     else if (__fltfield == (ios_base::fixed | ios_base::scientific))
       *__fptr++ = (__flags & ios_base::uppercase) ? 'A' : 'a';
 #endif
index 5f0a4bfb5e2622b2d2396268ba8e2fe95f530560..1a53c06aa216707a3488421d2d8f18defe6b4484 100644 (file)
@@ -23,7 +23,7 @@
 #include <exception>
 #include <stdlib.h>
 
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 void terminate() { _Exit(0); }
 
 void f() noexcept
@@ -39,7 +39,7 @@ void f() noexcept
 
 int main()
 {
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
   f();
 #endif
   return 0;
index ed3930aaf0bde5a39252bee8096ed0c31fc1d2a0..3f8e08d008f0229c6a47b7e1f54869468dff8364 100644 (file)
@@ -23,7 +23,7 @@
 #include <exception>
 #include <stdlib.h>
 
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 void unexpected() { _Exit(0); }
 
 void f() throw()
@@ -39,7 +39,7 @@ void f() throw()
 
 int main()
 {
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
   f();
 #endif
 }
index c270d76a21e00dedc768be2f40de9cc06eb022d3..ea284ccd529dceb70252d4ae8aa02e07a6779913 100644 (file)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
index 2bb7aea19dee9960968eeff0824187ca0ecc8a56..fd54d57c6ff2118c902d3745e4d3a1e2b64d7364 100644 (file)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
index 24aceb69ee78e947f422f11375c3c0a7ef294a7f..8cd0ea1ff997810e7bdbffdc564ec30da17e3dc3 100644 (file)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
index bc50156747a7aa8f48979ab232544804a83625d8..9be3f391507e651c7c5b8da92530fc6e24ac648c 100644 (file)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
index 1461adbe8787cb24d99c617021701d3169cce1ce..7d9e414970d162a81f84bb58e12d5ffb29626618 100644 (file)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
index cc91c247fb26fc4601305d0ba022209969fb4b28..2927da3382b95631130a895e9b7b7047ef1a8b96 100644 (file)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
index 6c26c2bb0f43ac281bf3a39c7c3b6db0219ba9f6..256cee546b3c30193e60250f98cba04aad0ea38d 100644 (file)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
index 91b647933942dd380cb37de879c0ad50c777a998..e102c6a0018ad4ca75729630b0feba57395e573a 100644 (file)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
index e36c30e0955ab8047035ccc079b95dbe408ed191..467bd9fc46e394a07a78db44391099b36e3f1a4c 100644 (file)
@@ -27,7 +27,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = true;
   using namespace std;
index 33f80008c0a23d4b80d3acc386b4d5f9ed0a4198..50c6b32835540d4ae86068f34b9885623cbae6ad 100644 (file)
@@ -19,7 +19,7 @@
 #include <cstdlib>
 #include <testsuite_hooks.h>
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 // libstdc++/13943
 void test01()
 {
@@ -36,7 +36,7 @@ void test01()
 
 int main()
 {
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
   test01();
 #endif
   return 0;
index 05110432e7350ec30e601dcaf308efca0a3ecdd8..bfcbe9a35430ed6858bfef1ffc2b9ef12fa9c29d 100644 (file)
 
 void test01()
 {
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 
   typedef std::lldiv_t     my_lldiv_t;
-  
+
 #endif
 }
 
index 9a6726c8ce7cb974a5bd522a5653b9d705858126..6a62dfd72717a1e007ae95751ac20ccabb56d58a 100644 (file)
@@ -1614,7 +1614,7 @@ proc check_v3_target_string_conversions { } {
 
         set f [open $src "w"]
         puts $f "#include <bits/c++config.h>"
-        puts $f "#if !defined(_GLIBCXX_USE_C99) || defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)"
+        puts $f "#if !(_GLIBCXX_USE_C99_STDIO && _GLIBCXX_USE_C99_STDLIB && _GLIBCXX_USE_C99_WCHAR) || defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)"
         puts $f "#  error No string conversions"
         puts $f "#endif"
         close $f
index b75fda20889991641d3170c186f5b9dddab2d262..ac8933c97e8a96a1c3fadfdfb913490936246241 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <tr1/cmath>
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_MATH
 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
 
 template<typename T>
index 0c913e025f35784ead71bf8339b77be09e02e1cf..5a9eb6c2c4ff4df586f56872f3e0c3318b756fc3 100644 (file)
@@ -30,7 +30,7 @@ void test01(int dummy, ...)
   std::va_list ap;
   va_start(ap, dummy);
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
 
   char* s = 0;
   const char* cs = 0;
index cfa748d5eb8ae991e9da1c9837ec6701c2028d25..dfa08ef894d9cbcffde7594a8cf80c4fe4629b41 100644 (file)
@@ -27,7 +27,7 @@
 
 void test01()
 {
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 
   long long i = 0;
   const char* s = 0;
index 002b6a59c834ef21850e348513d07e7b525b4436..12524634b339aaf49fcf75b93eea3bd852059411 100644 (file)
 
 void test01()
 {
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 
   typedef std::tr1::lldiv_t     my_lldiv_t;
-  
+
 #endif
 }
 
index b964661995f564a7d51ffabd83bd131e25866036..c745b19dc41536618860895e88e3cfa14f5dad23 100644 (file)
@@ -67,7 +67,7 @@ void test01(int dummy, ...)
   ret3 = ret3; // Suppress unused warning.
 #endif
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
   const wchar_t* nptr2 = 0;
   wchar_t** endptr2 = 0;
index 44aef115ff34b048e55820786d38522891e6c82d..ddcbdccf442659a8be231ec4a8983ff78958712a 100644 (file)
@@ -83,7 +83,7 @@ namespace __gnu_test
     p = tmp;
 #else
     char buf[64];
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
     std::snprintf(buf, 64, "filesystem-ts-test.%lu", (unsigned long)::getpid());
 #else
     std::sprintf(buf, "filesystem-ts-test.%lu", (unsigned long)::getpid());