public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [v3] Do not include <cstdarg>
@ 2007-05-21 19:23 Paolo Carlini
  0 siblings, 0 replies; only message in thread
From: Paolo Carlini @ 2007-05-21 19:23 UTC (permalink / raw)
  To: 'gcc-patches@gcc.gnu.org'

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

Hi,

tested x86-linux, committed to mainline.

Paolo.

////////////////////

[-- Attachment #2: CL_cstdarg --]
[-- Type: text/plain, Size: 167 bytes --]

2007-05-21  Paolo Carlini  <pcarlini@suse.de>

	* config/locale/gnu/c_locale.h: Do not include <cstdarg>, use builtins.
	* config/locale/generic/c_locale.h: Likewise.

[-- Attachment #3: patch_cstdarg --]
[-- Type: text/plain, Size: 1738 bytes --]

Index: config/locale/gnu/c_locale.h
===================================================================
--- config/locale/gnu/c_locale.h	(revision 124895)
+++ config/locale/gnu/c_locale.h	(working copy)
@@ -45,7 +45,6 @@
 #pragma GCC system_header
 
 #include <clocale>
-#include <cstdarg>
 #include <cstddef>
 
 #define _GLIBCXX_C_LOCALE_GNU 1
@@ -84,8 +83,8 @@
     std::setlocale(LC_ALL, "C");
 #endif
 
-    va_list __args;
-    va_start(__args, __fmt);
+    __builtin_va_list __args;
+    __builtin_va_start(__args, __fmt);
 
 #ifdef _GLIBCXX_USE_C99
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
@@ -93,7 +92,7 @@
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
 #endif
 
-    va_end(__args);
+    __builtin_va_end(__args);
 
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
     __gnu_cxx::__uselocale(__old);
Index: config/locale/generic/c_locale.h
===================================================================
--- config/locale/generic/c_locale.h	(revision 124895)
+++ config/locale/generic/c_locale.h	(working copy)
@@ -45,7 +45,6 @@
 #pragma GCC system_header
 
 #include <clocale>
-#include <cstdarg>
 #include <cstddef>
 
 #define _GLIBCXX_NUM_CATEGORIES 0
@@ -73,8 +72,8 @@
 	std::setlocale(LC_NUMERIC, "C");
       }
 
-    va_list __args;
-    va_start(__args, __fmt);
+    __builtin_va_list __args;
+    __builtin_va_start(__args, __fmt);
 
 #ifdef _GLIBCXX_USE_C99
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
@@ -82,8 +81,8 @@
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
 #endif
 
-    va_end(__args);
-      
+    __builtin_va_end(__args);
+
     if (__sav)
       {
 	std::setlocale(LC_NUMERIC, __sav);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-21 19:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-21 19:23 [v3] Do not include <cstdarg> Paolo Carlini

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).