]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorBenjamin Kosnik <bkoz@gcc.gnu.org>
Fri, 13 Sep 2002 02:25:49 +0000 (02:25 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Fri, 13 Sep 2002 02:25:49 +0000 (02:25 +0000)
2002-09-12  Benjamin Kosnik  <bkoz@redhat.com>

* libmath/Makefile.am (LIBTOOL): Use --tag CC always for this
directory.
* libmath/Makefile.in: Regenerate.
* src/Makefile.am: Tweak comment.
* src/Makefile.in: Regenerate.

* config/locale/gnu/c_locale.h: Remove warnings.
Inject __uselocale into __gnu_cxx.
* config/locale/generic/c_locale.h: Match.

2002-09-12  Benjamin Kosnik  <bkoz@redhat.com>

* include/bits/locale_facets.tcc (__convert_from_v): Remove.
* config/locale/gnu/c_locale.h (__convert_from_v): Add.
* config/locale/generic/c_locale.h (__convert_from_v): Add.

2002-09-12  Paolo Carlini  <pcarlini@unitus.it>

        * include/bits/locale_facets.tcc (__convert_from_v):
        Use __uselocale instead of setlocale for glibc 2.3+.

From-SVN: r57088

libstdc++-v3/ChangeLog
libstdc++-v3/config/locale/generic/c_locale.h
libstdc++-v3/config/locale/gnu/c_locale.h
libstdc++-v3/include/bits/locale_facets.tcc
libstdc++-v3/libmath/Makefile.am
libstdc++-v3/libmath/Makefile.in
libstdc++-v3/src/Makefile.am
libstdc++-v3/src/Makefile.in

index 2633f4cd0abe2df319b181d528fe22983f47d2ad..85ef8f782c3d92badb74ace9a9c33624e7154378 100644 (file)
@@ -1,3 +1,26 @@
+2002-09-12  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * libmath/Makefile.am (LIBTOOL): Use --tag CC always for this
+       directory.
+       * libmath/Makefile.in: Regenerate.
+       * src/Makefile.am: Tweak comment.
+       * src/Makefile.in: Regenerate.
+
+       * config/locale/gnu/c_locale.h: Remove warnings.
+       Inject __uselocale into __gnu_cxx.
+       * config/locale/generic/c_locale.h: Match.
+
+2002-09-12  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * include/bits/locale_facets.tcc (__convert_from_v): Remove.
+       * config/locale/gnu/c_locale.h (__convert_from_v): Add.
+       * config/locale/generic/c_locale.h (__convert_from_v): Add.     
+
+2002-09-12  Paolo Carlini  <pcarlini@unitus.it>
+
+        * include/bits/locale_facets.tcc (__convert_from_v):
+        Use __uselocale instead of setlocale for glibc 2.3+.
+
 2002-09-12  Benjamin Kosnik  <bkoz@redhat.com>
 
        * src/Makefile.am (sources): Edit.
index 0fc9a250c02ae78a798d38b9468fc62576dd1210..bfd9bf0a0bf193d9f7e92e0945b98870e8116639 100644 (file)
@@ -1,6 +1,6 @@
 // Wrapper for underlying C-language localization -*- C++ -*-
 
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 namespace std
 {
   typedef int*                 __c_locale;
+
+  template<typename _Tv>
+    int
+    __convert_from_v(char* __out, const int __size, const char* __fmt,
+                    _Tv __v, const __c_locale&, int __prec = -1)
+    {
+      char* __old = setlocale(LC_ALL, NULL);
+      char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
+      if (__sav)
+        strcpy(__sav, __old);
+      setlocale(LC_ALL, "C");
+
+      int __ret;
+#ifdef _GLIBCPP_USE_C99
+      if (__prec >= 0)
+        __ret = snprintf(__out, __size, __fmt, __prec, __v);
+      else
+        __ret = snprintf(__out, __size, __fmt, __v);
+#else
+      if (__prec >= 0)
+        __ret = sprintf(__out, __fmt, __prec, __v);
+      else
+        __ret = sprintf(__out, __fmt, __v);
+#endif
+      setlocale(LC_ALL, __sav);
+      free(__sav);
+      return __ret;
+    }
 }
index 3ce1781e23be3092a01b0d51898015b53bb659ce..aabbe6af42564a7a9f069695fa383cdd75f9dba1 100644 (file)
@@ -1,6 +1,6 @@
 // Wrapper for underlying C-language localization -*- C++ -*-
 
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 
 #define _GLIBCPP_C_LOCALE_GNU 1
 
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+namespace __gnu_cxx
+{
+  extern "C" __typeof(uselocale) __uselocale;
+}
+#endif
+
 namespace std
 {
   typedef __locale_t           __c_locale;
+
+  template<typename _Tv>
+    int
+    __convert_from_v(char* __out, const int __size, const char* __fmt,
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+                    _Tv __v, const __c_locale& __cloc, int __prec = -1)
+    {
+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
+#else
+                    _Tv __v, const __c_locale&, int __prec = -1)
+    {
+      char* __old = setlocale(LC_ALL, NULL);
+      char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
+      if (__sav)
+        strcpy(__sav, __old);
+      setlocale(LC_ALL, "C");
+#endif
+
+      int __ret;
+#ifdef _GLIBCPP_USE_C99
+      if (__prec >= 0)
+        __ret = snprintf(__out, __size, __fmt, __prec, __v);
+      else
+        __ret = snprintf(__out, __size, __fmt, __v);
+#else
+      if (__prec >= 0)
+        __ret = sprintf(__out, __fmt, __prec, __v);
+      else
+        __ret = sprintf(__out, __fmt, __v);
+#endif
+
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+      __gnu_cxx::__uselocale(__old);
+#else
+      setlocale(LC_ALL, __sav);
+      free(__sav);
+#endif
+      return __ret;
+    }
 }
index ad7ba3f5320362a28f317a9209943e9a34f9f8c4..195d33ab040737347d167550d4cd25f19f66544b 100644 (file)
@@ -1969,47 +1969,10 @@ namespace std
   // Convert numeric value of type _Tv to string and return length of string.
   // If snprintf is available use it, otherwise fall back to the unsafe sprintf
   // which, in general, can be dangerous and should be avoided.
-#ifdef _GLIBCPP_USE_C99
   template<typename _Tv>
     int
     __convert_from_v(char* __out, const int __size, const char* __fmt,
-                    _Tv __v, const __c_locale&, int __prec = -1)
-    {
-      int __ret;
-      char* __old = setlocale(LC_ALL, NULL);
-      char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
-      if (__sav)
-        strcpy(__sav, __old);
-      setlocale(LC_ALL, "C");
-      if (__prec >= 0)
-        __ret = snprintf(__out, __size, __fmt, __prec, __v);
-      else
-        __ret = snprintf(__out, __size, __fmt, __v);
-      setlocale(LC_ALL, __sav);
-      free(__sav);
-      return __ret;
-    }
-#else
-  template<typename _Tv>
-    int
-    __convert_from_v(char* __out, const int, const char* __fmt, _Tv __v,
-                    const __c_locale&, int __prec = -1)
-    {
-      int __ret;
-      char* __old = setlocale(LC_ALL, NULL);
-      char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
-      if (__sav)
-        strcpy(__sav, __old);
-      setlocale(LC_ALL, "C");
-      if (__prec >= 0)
-        __ret = sprintf(__out, __fmt, __prec, __v);
-      else
-        __ret = sprintf(__out, __fmt, __v);
-      setlocale(LC_ALL, __sav);
-      free(__sav);
-      return __ret;
-    }
-#endif
+                    _Tv __v, const __c_locale&, int __prec = -1);
 
   // Construct correctly padded string, as per 22.2.2.2.2
   // Assumes 
index 27d76e93f20899285628ea5a02b7de3b052f7d8a..c1bf4be5aeda14ab7912379bb4f739a59bd59532 100644 (file)
@@ -34,12 +34,11 @@ libmath_la_DEPENDENCIES = $(libmath_la_LIBADD)
 
 libmath_la_SOURCES = stubs.c
 
-LINK = \
-       $(LIBTOOL) --tag CC --mode=link "$(CCLD)" \
-       $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-
 # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
 
 INCLUDES = \
        $(TOPLEVEL_INCLUDES) 
+
+# Only compiling "C" sources in this directory.
+LIBTOOL = @LIBTOOL@ --tag CC
\ No newline at end of file
index 375b9ad31d44ce1865379746b5105bd2f0f6251c..7640e684662d6281ab70aad41fb7e83228cd317a 100644 (file)
@@ -92,7 +92,6 @@ LIBMATHOBJS = @LIBMATHOBJS@
 LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
 LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
 LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
-LIBTOOL = @LIBTOOL@
 LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
 LN_S = @LN_S@
 MAINT = @MAINT@
@@ -144,17 +143,15 @@ libmath_la_DEPENDENCIES = $(libmath_la_LIBADD)
 
 libmath_la_SOURCES = stubs.c
 
-LINK = \
-       $(LIBTOOL) --tag CC --mode=link "$(CCLD)" \
-       $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-
-
 # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
 
 INCLUDES = \
        $(TOPLEVEL_INCLUDES) 
 
+
+# Only compiling "C" sources in this directory.
+LIBTOOL = @LIBTOOL@ --tag CC
 CONFIG_HEADER = ../config.h
 CONFIG_CLEAN_FILES = 
 LTLIBRARIES =  $(noinst_LTLIBRARIES)
@@ -170,6 +167,7 @@ CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
 DIST_COMMON =  Makefile.am Makefile.in
 
 
index 9678b766b2c8712d6c866daa718ea3f4ed9649d0..4592168f48d6a0c27ca339218d28a8a8260120e5 100644 (file)
@@ -27,7 +27,7 @@ MAINT_CHARSET = latin1
 
 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
 
-# Cross compiler and multilib support.
+# Cross compiler support.
 CXX = @glibcpp_CXX@
 toolexecdir = @glibcpp_toolexecdir@
 toolexeclibdir = @glibcpp_toolexeclibdir@
index 6e5b364f2ae9bb05c941b8532fabca046272e7f4..0e55017baf0aaf71c542efa882e538f1f333f006 100644 (file)
@@ -130,7 +130,7 @@ MAINT_CHARSET = latin1
 
 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
 
-# Cross compiler and multilib support.
+# Cross compiler support.
 CXX = @glibcpp_CXX@
 toolexecdir = @glibcpp_toolexecdir@
 toolexeclibdir = @glibcpp_toolexeclibdir@