public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jennifer Yao <jenny.hyphen.fa@gmail.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: Fwd: [PATCH] Enable libstdc++ numeric conversions on Cygwin
Date: Sat, 19 Sep 2015 21:00:00 -0000	[thread overview]
Message-ID: <CAPQfdh=o+wg0af_DStTBw+tGzZ7dOWmdzPGjbj5CC=d-+uUaPw@mail.gmail.com> (raw)
In-Reply-To: <20150918154917.GO2969@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2878 bytes --]

> Do you already have a copyright assignment for GCC?
>
> If not, would you be willing to complete one?

No, but I would be willing to complete one, yes. Are you willing to
send me the appropriate forms, or should I contact someone else?

> N.B. I don't see a patch attached to your mail, but that's not a
> problem for now as I don't want to look at it until I know the status
> of your copyright assignment (if we don't end up using your patch and
> I do it myself then I don't want to plagiarise your work!)

I included the patch in a reply to my original message to
libstdc++@gcc.gnu.org, but I'll attach it here as well.

By the way, the changes that I made are not really that extensive; I
even (unknowingly!) duplicated much of an earlier patch that was
submitted on Bugzilla
<https://gcc.gnu.org/bugzilla/attachment.cgi?id=33060>, although the
poster apparently never got around to testing it.

> THanks for doing this work, it will help several other platforms, not
> only Cygwin.

No problem. ^.^

On Fri, Sep 18, 2015 at 11:49 AM, Jonathan Wakely <jwakely@redhat.com> wrote:
> On 18/09/15 11:17 -0400, Jennifer Yao wrote:
>>
>> A number of functions in libstdc++ are guarded by the _GLIBCXX_USE_C99
>> preprocessor macro, which is only defined on systems that pass all of
>> the checks for a large set of C99 functions. Consequently, on systems
>> which lack any of the required C99 facilities (e.g. Cygwin, which
>> lacks some C99 complex math functions), the numeric conversion
>> functions (std::stoi(), std::stol(), std::to_string(), etc.) are not
>> defined—a rather silly outcome, as none of the numeric conversion
>> functions are implemented using C99 math functions.
>>
>> This patch enables numeric conversion functions on the aforementioned
>> systems by splitting the checks for C99 support and defining several
>> new macros (_GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, and
>> _GLIBCXX_USE_C99_WCHAR), which replace the use of _GLIBCXX_USE_C99 in
>> #if conditionals where appropriate.
>
>
> Awesome! This has been on my TODO list for ages, but I've not made
> much progress. I *definitely* want to see this change happen, but
> there are some legal prerequisites that need to be met before that can
> happen, see
> https://gcc.gnu.org/onlinedocs/libstdc++/manual/appendix_contributing.html#contrib.list
>
> Do you already have a copyright assignment for GCC?
>
> If not, would you be willing to complete one?
>
> THanks for doing this work, it will help several other platforms, not
> only Cygwin.
>
>
> N.B. I don't see a patch attached to your mail, but that's not a
> problem for now as I don't want to look at it until I know the status
> of your copyright assignment (if we don't end up using your patch and
> I do it myself then I don't want to plagiarise your work!)
>
>
>

[-- Attachment #2: libstdc++-numeric-conversions.patch --]
[-- Type: application/octet-stream, Size: 42659 bytes --]

Index: libstdc++-v3/acinclude.m4
===================================================================
--- libstdc++-v3/acinclude.m4	(revision 227708)
+++ libstdc++-v3/acinclude.m4	(working copy)
@@ -915,236 +915,246 @@
   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++0x (instead of -std=c++98) because C headers on some systems
+    # require it to enable C99 functions, and because the default
+    # (-std=gnu++98 / -std=gnu++0x) leaves __STRICT_ANSI__ undefined and fake
+    # C99 facilities - like pre-standard snprintf - may be spuriously enabled.
+    ac_save_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="$CXXFLAGS -std=c++0x"
+    ac_save_LIBS="$LIBS"
+    ac_save_gcc_no_link="$gcc_no_link"
 
-  # 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"
+    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
 
-  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 <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])
     ])
-  fi
+    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 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 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>])
+      AC_CACHE_VAL(glibcxx_cv_c99_complex, [
+        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 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)
+    if test x"$glibcxx_cv_c99_stdio" = x"yes"; then
+      AC_DEFINE(_GLIBCXX_USE_C99_STDIO, 1,
+        [Define if C99 functions or macros in <stdio.h> should be imported
+        in <cstdio> in namespace std.])
+    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)
+    if test x"$glibcxx_cv_c99_stdlib" = x"yes"; then
+      AC_DEFINE(_GLIBCXX_USE_C99_STDLIB, 1,
+        [Define if C99 functions or macros in <stdlib.h> should be imported
+        in <cstdlib> in namespace std.])
+    fi
 
-  # 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.
+    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_CACHE_VAL(glibcxx_cv_c99_wchar, [
+        AC_TRY_COMPILE([#include <wchar.h>
+          namespace test
+          {
+            using ::wcstold;
+            using ::wcstoll;
+            using ::wcstoull;
+          }
+        ], [], [glibcxx_cv_c99_wchar=yes], [glibcxx_cv_c99_wchar=no])
+      ])
 
-  # 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.])], [])
 
-    # 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 ::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 ::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 <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_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)
+      if test x"$glibcxx_cv_c99_wchar" = x"yes"; then
+        AC_DEFINE(_GLIBCXX_USE_C99_WCHAR, 1,
+          [Define if C99 functions or macros in <wchar.h> should be imported
+          in <cwchar> in namespace std.])
+      fi
+    fi
 
-    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
 
-  # 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.])
+    gcc_no_link="$ac_save_gcc_no_link"
+    LIBS="$ac_save_LIBS"
+    CXXFLAGS="$ac_save_CXXFLAGS"
+    AC_LANG_RESTORE
   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])
   AC_MSG_RESULT($enable_c99)
 ])
@@ -1441,14 +1447,15 @@
 dnl facilities in Chapter 8, "C compatibility".
 dnl
 AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
-
   AC_LANG_SAVE
   AC_LANG_CPLUSPLUS
 
-  # Use -std=c++98 because the default (-std=gnu++98) leaves __STRICT_ANSI__
-  # undefined and fake C99 facilities may be spuriously enabled.
+  # Use -std=c++0x (instead of -std=c++98) because C headers on some systems
+  # require it to enable C99 functions, and because the default
+  # (-std=gnu++98 / -std=gnu++0x) leaves __STRICT_ANSI__ undefined and fake
+  # C99 facilities - like pre-standard snprintf - may be spuriously enabled.
   ac_save_CXXFLAGS="$CXXFLAGS"
-  CXXFLAGS="$CXXFLAGS -std=c++98"
+  CXXFLAGS="$CXXFLAGS -std=c++0x"
 
   # Check for the existence of <complex.h> complex math functions used
   # by tr1/complex.
Index: libstdc++-v3/config/locale/dragonfly/c_locale.h
===================================================================
--- libstdc++-v3/config/locale/dragonfly/c_locale.h	(revision 227708)
+++ libstdc++-v3/config/locale/dragonfly/c_locale.h	(working copy)
@@ -64,7 +64,7 @@
     __builtin_va_list __args;
     __builtin_va_start(__args, __fmt);
 
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_STDIO
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
 #else
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
Index: libstdc++-v3/config/locale/generic/c_locale.h
===================================================================
--- libstdc++-v3/config/locale/generic/c_locale.h	(revision 227708)
+++ libstdc++-v3/config/locale/generic/c_locale.h	(working copy)
@@ -70,7 +70,7 @@
     __builtin_va_list __args;
     __builtin_va_start(__args, __fmt);
 
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_STDIO
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
 #else
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
Index: libstdc++-v3/config/locale/gnu/c_locale.h
===================================================================
--- libstdc++-v3/config/locale/gnu/c_locale.h	(revision 227708)
+++ libstdc++-v3/config/locale/gnu/c_locale.h	(working copy)
@@ -88,7 +88,7 @@
     __builtin_va_list __args;
     __builtin_va_start(__args, __fmt);
 
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_STDIO
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
 #else
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
Index: libstdc++-v3/config/os/bsd/dragonfly/os_defines.h
===================================================================
--- libstdc++-v3/config/os/bsd/dragonfly/os_defines.h	(revision 227708)
+++ libstdc++-v3/config/os/bsd/dragonfly/os_defines.h	(working copy)
@@ -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: libstdc++-v3/include/bits/basic_string.h
===================================================================
--- libstdc++-v3/include/bits/basic_string.h	(revision 227708)
+++ libstdc++-v3/include/bits/basic_string.h	(working copy)
@@ -5383,7 +5383,7 @@
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
+#if __cplusplus >= 201103L
 
 #include <ext/string_conversions.h>
 
@@ -5392,6 +5392,7 @@
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _GLIBCXX_BEGIN_NAMESPACE_CXX11
 
+#ifdef _GLIBCXX_USE_C99_STDLIB
   // 21.4 Numeric Conversions [string.conversions].
   inline int
   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
@@ -5430,7 +5431,9 @@
   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
 
+#ifdef _GLIBCXX_USE_C99_STDIO
   // NB: (v)snprintf vs sprintf.
 
   // DR 1261.
@@ -5494,8 +5497,9 @@
     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(),
@@ -5597,13 +5601,13 @@
 					    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: libstdc++-v3/include/bits/locale_facets.tcc
===================================================================
--- libstdc++-v3/include/bits/locale_facets.tcc	(revision 227708)
+++ libstdc++-v3/include/bits/locale_facets.tcc	(working copy)
@@ -959,13 +959,13 @@
     }
 
   // 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 @@
 	char __fbuf[16];
 	__num_base::_S_format_float(__io, __fbuf, __mod);
 
-#ifdef _GLIBCXX_USE_C99
+#ifdef _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: libstdc++-v3/include/bits/locale_facets_nonio.tcc
===================================================================
--- libstdc++-v3/include/bits/locale_facets_nonio.tcc	(revision 227708)
+++ libstdc++-v3/include/bits/locale_facets_nonio.tcc	(working copy)
@@ -578,7 +578,7 @@
     {
       const locale __loc = __io.getloc();
       const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_STDIO
       // First try a buffer perhaps big enough.
       int __cs_size = 64;
       char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
Index: libstdc++-v3/include/c_compatibility/math.h
===================================================================
--- libstdc++-v3/include/c_compatibility/math.h	(revision 227708)
+++ libstdc++-v3/include/c_compatibility/math.h	(working copy)
@@ -56,7 +56,7 @@
 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: libstdc++-v3/include/c_compatibility/wchar.h
===================================================================
--- libstdc++-v3/include/c_compatibility/wchar.h	(revision 227708)
+++ libstdc++-v3/include/c_compatibility/wchar.h	(working copy)
@@ -103,7 +103,7 @@
 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: libstdc++-v3/include/c_global/cstdio
===================================================================
--- libstdc++-v3/include/c_global/cstdio	(revision 227708)
+++ libstdc++-v3/include/c_global/cstdio	(working copy)
@@ -146,7 +146,7 @@
   using ::vsprintf;
 } // namespace
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
 
 #undef snprintf
 #undef vfscanf
@@ -189,6 +189,6 @@
   using ::__gnu_cxx::vsscanf;
 } // namespace std
 
-#endif // _GLIBCXX_USE_C99
+#endif // _GLIBCXX_USE_C99_STDIO
 
 #endif
Index: libstdc++-v3/include/c_global/cstdlib
===================================================================
--- libstdc++-v3/include/c_global/cstdlib	(revision 227708)
+++ libstdc++-v3/include/c_global/cstdlib	(working copy)
@@ -195,7 +195,7 @@
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 
 #undef _Exit
 #undef llabs
@@ -266,7 +266,7 @@
   using ::__gnu_cxx::strtold;
 } // namespace std
 
-#endif // _GLIBCXX_USE_C99
+#endif // _GLIBCXX_USE_C99_STDLIB
 
 #endif // !_GLIBCXX_HOSTED
 
Index: libstdc++-v3/include/c_global/cwchar
===================================================================
--- libstdc++-v3/include/c_global/cwchar	(revision 227708)
+++ libstdc++-v3/include/c_global/cwchar	(working copy)
@@ -232,7 +232,7 @@
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
 #undef wcstold
 #undef wcstoll
@@ -289,7 +289,7 @@
   using std::vwscanf;
 #endif
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
   using std::wcstold;
   using std::wcstoll;
   using std::wcstoull;
Index: libstdc++-v3/include/c_std/cstdio
===================================================================
--- libstdc++-v3/include/c_std/cstdio	(revision 227708)
+++ libstdc++-v3/include/c_std/cstdio	(working copy)
@@ -144,7 +144,7 @@
   using ::vsprintf;
 } // namespace std
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
 
 #undef snprintf
 #undef vfscanf
Index: libstdc++-v3/include/c_std/cstdlib
===================================================================
--- libstdc++-v3/include/c_std/cstdlib	(revision 227708)
+++ libstdc++-v3/include/c_std/cstdlib	(working copy)
@@ -192,7 +192,7 @@
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 
 #undef _Exit
 #undef llabs
@@ -263,7 +263,7 @@
   using ::__gnu_cxx::strtold;
 } // namespace std
 
-#endif // _GLIBCXX_USE_C99
+#endif // _GLIBCXX_USE_C99_STDLIB
 
 #endif // !_GLIBCXX_HOSTED
 
Index: libstdc++-v3/include/c_std/cwchar
===================================================================
--- libstdc++-v3/include/c_std/cwchar	(revision 227708)
+++ libstdc++-v3/include/c_std/cwchar	(working copy)
@@ -228,7 +228,7 @@
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
 #undef wcstold
 #undef wcstoll
Index: libstdc++-v3/include/ext/vstring.h
===================================================================
--- libstdc++-v3/include/ext/vstring.h	(revision 227708)
+++ libstdc++-v3/include/ext/vstring.h	(working copy)
@@ -2680,7 +2680,7 @@
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99))
+#if __cplusplus >= 201103L
 
 #include <ext/string_conversions.h>
 
@@ -2688,6 +2688,7 @@
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
+#ifdef _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 @@
   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
 
+#ifdef _GLIBCXX_USE_C99_STDIO
   // NB: (v)snprintf vs sprintf.
 
   // DR 1261.
@@ -2789,8 +2792,9 @@
     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 @@
     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: libstdc++-v3/include/tr1/cstdio
===================================================================
--- libstdc++-v3/include/tr1/cstdio	(revision 227708)
+++ libstdc++-v3/include/tr1/cstdio	(working copy)
@@ -33,7 +33,7 @@
 
 #include <cstdio>
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
Index: libstdc++-v3/include/tr1/cstdlib
===================================================================
--- libstdc++-v3/include/tr1/cstdlib	(revision 227708)
+++ libstdc++-v3/include/tr1/cstdlib	(working copy)
@@ -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 @@
 }
 }
 
-#endif // _GLIBCXX_USE_C99 
+#endif // _GLIBCXX_USE_C99_STDLIB
 
 #endif // _GLIBCXX_HOSTED
 
Index: libstdc++-v3/include/tr1/cwchar
===================================================================
--- libstdc++-v3/include/tr1/cwchar	(revision 227708)
+++ libstdc++-v3/include/tr1/cwchar	(working copy)
@@ -52,7 +52,7 @@
   using std::vwscanf;
 #endif
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
   using std::wcstold;
   using std::wcstoll;
   using std::wcstoull;
Index: libstdc++-v3/include/tr1/stdlib.h
===================================================================
--- libstdc++-v3/include/tr1/stdlib.h	(revision 227708)
+++ libstdc++-v3/include/tr1/stdlib.h	(working copy)
@@ -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: libstdc++-v3/src/c++11/debug.cc
===================================================================
--- libstdc++-v3/src/c++11/debug.cc	(revision 227708)
+++ libstdc++-v3/src/c++11/debug.cc	(working copy)
@@ -871,7 +871,7 @@
 				     int __n __attribute__ ((__unused__)),
 				     const char* __fmt, _Tp __s) const throw ()
     {
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_STDIO
       std::snprintf(__buf, __n, __fmt, __s);
 #else
       std::sprintf(__buf, __fmt, __s);
Index: libstdc++-v3/src/c++98/locale_facets.cc
===================================================================
--- libstdc++-v3/src/c++98/locale_facets.cc	(revision 227708)
+++ libstdc++-v3/src/c++98/locale_facets.cc	(working copy)
@@ -72,7 +72,7 @@
 
     ios_base::fmtflags __fltfield = __flags & ios_base::floatfield;
 
-#ifdef _GLIBCXX_USE_C99
+#ifdef _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 @@
       *__fptr++ = 'f';
     else if (__fltfield == ios_base::scientific)
       *__fptr++ = (__flags & ios_base::uppercase) ? 'E' : 'e';
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_STDIO
     else if (__fltfield == (ios_base::fixed | ios_base::scientific))
       *__fptr++ = (__flags & ios_base::uppercase) ? 'A' : 'a';
 #endif
Index: libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc
===================================================================
--- libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc	(revision 227708)
+++ libstdc++-v3/testsuite/18_support/exception_ptr/60612-terminate.cc	(working copy)
@@ -23,7 +23,7 @@
 #include <exception>
 #include <stdlib.h>
 
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_STDLIB
 void terminate() { _Exit(0); }
 
 void f() noexcept
@@ -39,7 +39,7 @@
 
 int main()
 {
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_STDLIB
   f();
 #endif
   return 0;
Index: libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc
===================================================================
--- libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc	(revision 227708)
+++ libstdc++-v3/testsuite/18_support/exception_ptr/60612-unexpected.cc	(working copy)
@@ -23,7 +23,7 @@
 #include <exception>
 #include <stdlib.h>
 
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_STDLIB
 void unexpected() { _Exit(0); }
 
 void f() throw()
@@ -39,7 +39,7 @@
 
 int main()
 {
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_STDLIB
   f();
 #endif
 }
Index: libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc
===================================================================
--- libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc	(revision 227708)
+++ libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc	(working copy)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
Index: libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stof.cc
===================================================================
--- libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stof.cc	(revision 227708)
+++ libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stof.cc	(working copy)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
Index: libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoi.cc
===================================================================
--- libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoi.cc	(revision 227708)
+++ libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoi.cc	(working copy)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
Index: libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stol.cc
===================================================================
--- libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stol.cc	(revision 227708)
+++ libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stol.cc	(working copy)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
Index: libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc
===================================================================
--- libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc	(revision 227708)
+++ libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc	(working copy)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
Index: libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoll.cc
===================================================================
--- libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoll.cc	(revision 227708)
+++ libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoll.cc	(working copy)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
Index: libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoul.cc
===================================================================
--- libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoul.cc	(revision 227708)
+++ libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoul.cc	(working copy)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
Index: libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoull.cc
===================================================================
--- libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoull.cc	(revision 227708)
+++ libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoull.cc	(working copy)
@@ -29,7 +29,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = false;
   using namespace std;
Index: libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/to_wstring.cc
===================================================================
--- libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/to_wstring.cc	(revision 227708)
+++ libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/to_wstring.cc	(working copy)
@@ -27,7 +27,7 @@
 void
 test01()
 {
-#ifdef _GLIBCXX_USE_C99
+#ifdef _GLIBCXX_USE_C99_WCHAR
 
   bool test __attribute__((unused)) = true;
   using namespace std;
Index: libstdc++-v3/testsuite/26_numerics/headers/cstdlib/13943.cc
===================================================================
--- libstdc++-v3/testsuite/26_numerics/headers/cstdlib/13943.cc	(revision 227708)
+++ libstdc++-v3/testsuite/26_numerics/headers/cstdlib/13943.cc	(working copy)
@@ -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 @@
 
 int main()
 {
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
   test01();
 #endif
   return 0;
Index: libstdc++-v3/testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc
===================================================================
--- libstdc++-v3/testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc	(revision 227708)
+++ libstdc++-v3/testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc	(working copy)
@@ -24,10 +24,10 @@
 
 void test01()
 {
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 
   typedef std::lldiv_t     my_lldiv_t;
-  
+
 #endif
 }
 
Index: libstdc++-v3/testsuite/lib/libstdc++.exp
===================================================================
--- libstdc++-v3/testsuite/lib/libstdc++.exp	(revision 227708)
+++ libstdc++-v3/testsuite/lib/libstdc++.exp	(working copy)
@@ -1607,7 +1607,7 @@
 
         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 !(defined(_GLIBCXX_USE_C99_STDIO) && defined(_GLIBCXX_USE_C99_STDLIB) && defined(_GLIBCXX_USE_C99_WCHAR)) || defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)"
         puts $f "#  error No string conversions"
         puts $f "#endif"
         close $f
Index: libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/templates.cc
===================================================================
--- libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/templates.cc	(revision 227708)
+++ libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/templates.cc	(working copy)
@@ -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: libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdio/functions.cc
===================================================================
--- libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdio/functions.cc	(revision 227708)
+++ libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdio/functions.cc	(working copy)
@@ -30,7 +30,7 @@
   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: libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/functions.cc
===================================================================
--- libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/functions.cc	(revision 227708)
+++ libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/functions.cc	(working copy)
@@ -27,7 +27,7 @@
 
 void test01()
 {
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 
   long long i = 0;
   const char* s = 0;
Index: libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc
===================================================================
--- libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc	(revision 227708)
+++ libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc	(working copy)
@@ -27,10 +27,10 @@
 
 void test01()
 {
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDLIB
 
   typedef std::tr1::lldiv_t     my_lldiv_t;
-  
+
 #endif
 }
 
Index: libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc
===================================================================
--- libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc	(revision 227708)
+++ libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc	(working copy)
@@ -67,7 +67,7 @@
   ret3 = ret3; // Suppress unused warning.
 #endif
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_WCHAR
 
   const wchar_t* nptr2 = 0;
   wchar_t** endptr2 = 0;

  reply	other threads:[~2015-09-19 19:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18 15:19 Jennifer Yao
     [not found] ` <CAPQfdhmMGJeb-tq29jTheoo5jUaeiFzcycWFTrpShRE-kPftGw@mail.gmail.com>
2015-09-18 15:51   ` Fwd: " Jonathan Wakely
2015-09-19 21:00     ` Jennifer Yao [this message]
2015-09-21 12:37       ` Jonathan Wakely
     [not found]   ` <CAPQfdh=uOjLzi60Dnd0Dd1ycJUDqMWQBCv1aRAGBP97DSUS3+Q@mail.gmail.com>
     [not found]     ` <20151112114049.GY2937@redhat.com>
2015-11-12 13:40       ` Jonathan Wakely
2015-11-12 14:50         ` Jonathan Wakely
2015-11-12 17:25           ` Jennifer Yao
2015-11-12 17:56             ` Jonathan Wakely
2015-11-12 22:56         ` Andreas Tobler
2015-11-13 14:52         ` Jonathan Wakely
2015-11-14  8:37           ` Christophe Lyon
2015-11-14 13:58             ` Jonathan Wakely
2015-11-14 21:23               ` Jennifer Yao
2015-11-15 21:38                 ` Jennifer Yao
2015-11-16  9:48                   ` Jonathan Wakely
2015-11-14 16:32             ` Jonathan Wakely
2015-11-15  8:58               ` Christophe Lyon
2015-11-15 11:14                 ` Jonathan Wakely
2015-11-15 16:25                   ` Christophe Lyon
2015-12-08 10:59           ` Alan Lawrence

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPQfdh=o+wg0af_DStTBw+tGzZ7dOWmdzPGjbj5CC=d-+uUaPw@mail.gmail.com' \
    --to=jenny.hyphen.fa@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).