]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pod_char_traits.h (char_traits<>::move): Use __builtin_memmove.
authorPaolo Carlini <paolo@gcc.gnu.org>
Fri, 11 May 2007 18:58:08 +0000 (18:58 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 11 May 2007 18:58:08 +0000 (18:58 +0000)
2007-05-11  Paolo Carlini  <pcarlini@suse.de>

* include/ext/pod_char_traits.h (char_traits<>::move):
Use __builtin_memmove.
* include/bits/locale_classes.h (locale::_Impl::_M_check_same_name,
collate_byname(const char*, size_t)): Use __builtin_strcmp.
* include/bits/locale_facets.h: Use __builtin_mem* and
__builtin_str* everywhere.
* include/bits/codecvt.h (codecvt_byname(const char*, size_t)):
Use __builtin_strcmp.
* include/bits/char_traits.h: Use __builtin_mem* everywhere.
* include/bits/fstream.tcc (basic_filebuf<>::underflow, imbue):
Use __builtin_memcpy and __builtin_memmove.
* include/bits/locale_facets_nonio.h (moneypunct_byname(const char*,
size_t __refs)): Use __builtin_strcmp.
* include/std/bitset (bitset<>::_M_do_reset): Use __builtin_memset.
* config/locale/gnu/c_locale.h: Use __builtin_strlen, __builtin_strcmp,
and __builtin_memcpy.
* config/locale/gnu/messages_members.h: Likewise.
* config/locale/gnu/time_members.h: Likewise.
* config/locale/generic/c_locale.h: Likewise.
* config/locale/generic/messages_members.h: Likewise.
* config/locale/generic/time_members.h: Likewise.
* config/os/gnu-linux/ctype_noninline.h: Likewise, avoid strdup.
* config/os/tpf/ctype_noninline.h: Likewise.
* config/locale/generic/codecvt_members.cc: Include <cstring>.
* config/locale/generic/ctype_members.cc: Likewise.
* config/locale/generic/collate_members.cc: Likewise.
* config/locale/gnu/c++locale_internal.h: Likewise.
* config/locale/darwin/ctype_members.cc: Likewise.
* src/ctype.cc: Likewise.
* testsuite/19_diagnostics/logic_error/what-1.cc: Likewise.
* testsuite/19_diagnostics/logic_error/what-2.cc: Likewise.
* testsuite/19_diagnostics/runtime_error/what-1.cc: Likewise.
* testsuite/19_diagnostics/runtime_error/what-2.cc: Likewise.
* testsuite/19_diagnostics/runtime_error/what-3.cc: Likewise.
* config/locale/gnu/messages_members.cc: Avoid strdup.
* config/locale/gnu/monetary_members.cc: Likewise.
* config/locale/gnu/time_members.cc: Likewise.
* config/locale/gnu/time_members.cc: Likewise.
* config/locale/generic/c_locale.cc: Likewise.

From-SVN: r124623

33 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/config/locale/darwin/ctype_members.cc
libstdc++-v3/config/locale/generic/c_locale.cc
libstdc++-v3/config/locale/generic/c_locale.h
libstdc++-v3/config/locale/generic/codecvt_members.cc
libstdc++-v3/config/locale/generic/collate_members.cc
libstdc++-v3/config/locale/generic/ctype_members.cc
libstdc++-v3/config/locale/generic/messages_members.h
libstdc++-v3/config/locale/generic/time_members.cc
libstdc++-v3/config/locale/generic/time_members.h
libstdc++-v3/config/locale/gnu/c++locale_internal.h
libstdc++-v3/config/locale/gnu/c_locale.h
libstdc++-v3/config/locale/gnu/messages_members.cc
libstdc++-v3/config/locale/gnu/messages_members.h
libstdc++-v3/config/locale/gnu/monetary_members.cc
libstdc++-v3/config/locale/gnu/time_members.cc
libstdc++-v3/config/locale/gnu/time_members.h
libstdc++-v3/config/os/gnu-linux/ctype_noninline.h
libstdc++-v3/config/os/tpf/ctype_noninline.h
libstdc++-v3/include/bits/char_traits.h
libstdc++-v3/include/bits/codecvt.h
libstdc++-v3/include/bits/fstream.tcc
libstdc++-v3/include/bits/locale_classes.h
libstdc++-v3/include/bits/locale_facets.h
libstdc++-v3/include/bits/locale_facets_nonio.h
libstdc++-v3/include/ext/pod_char_traits.h
libstdc++-v3/include/std/bitset
libstdc++-v3/src/ctype.cc
libstdc++-v3/testsuite/19_diagnostics/logic_error/what-1.cc
libstdc++-v3/testsuite/19_diagnostics/logic_error/what-2.cc
libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-1.cc
libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-2.cc
libstdc++-v3/testsuite/19_diagnostics/runtime_error/what-3.cc

index 11f587a79528205b5c7a1630f39ebb6c81ca74a1..ec198c0705a98f3ca4d22781fe724cf3cdee3c85 100644 (file)
@@ -1,18 +1,60 @@
+2007-05-11  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/ext/pod_char_traits.h (char_traits<>::move):
+       Use __builtin_memmove.
+       * include/bits/locale_classes.h (locale::_Impl::_M_check_same_name,
+       collate_byname(const char*, size_t)): Use __builtin_strcmp.
+       * include/bits/locale_facets.h: Use __builtin_mem* and
+       __builtin_str* everywhere.
+       * include/bits/codecvt.h (codecvt_byname(const char*, size_t)):
+       Use __builtin_strcmp.
+       * include/bits/char_traits.h: Use __builtin_mem* everywhere.
+       * include/bits/fstream.tcc (basic_filebuf<>::underflow, imbue):
+       Use __builtin_memcpy and __builtin_memmove.
+       * include/bits/locale_facets_nonio.h (moneypunct_byname(const char*,
+       size_t __refs)): Use __builtin_strcmp.
+       * include/std/bitset (bitset<>::_M_do_reset): Use __builtin_memset.
+       * config/locale/gnu/c_locale.h: Use __builtin_strlen, __builtin_strcmp,
+       and __builtin_memcpy.
+       * config/locale/gnu/messages_members.h: Likewise.
+       * config/locale/gnu/time_members.h: Likewise.
+       * config/locale/generic/c_locale.h: Likewise.
+       * config/locale/generic/messages_members.h: Likewise.
+       * config/locale/generic/time_members.h: Likewise.
+       * config/os/gnu-linux/ctype_noninline.h: Likewise, avoid strdup.
+       * config/os/tpf/ctype_noninline.h: Likewise.
+       * config/locale/generic/codecvt_members.cc: Include <cstring>. 
+       * config/locale/generic/ctype_members.cc: Likewise.
+       * config/locale/generic/collate_members.cc: Likewise.
+       * config/locale/gnu/c++locale_internal.h: Likewise.
+       * config/locale/darwin/ctype_members.cc: Likewise.
+       * src/ctype.cc: Likewise.
+       * testsuite/19_diagnostics/logic_error/what-1.cc: Likewise.
+       * testsuite/19_diagnostics/logic_error/what-2.cc: Likewise.
+       * testsuite/19_diagnostics/runtime_error/what-1.cc: Likewise.
+       * testsuite/19_diagnostics/runtime_error/what-2.cc: Likewise.
+       * testsuite/19_diagnostics/runtime_error/what-3.cc: Likewise.
+       * config/locale/gnu/messages_members.cc: Avoid strdup.
+       * config/locale/gnu/monetary_members.cc: Likewise.
+       * config/locale/gnu/time_members.cc: Likewise.  
+       * config/locale/gnu/time_members.cc: Likewise.
+       * config/locale/generic/c_locale.cc: Likewise.
+
 2007-05-11  Benjamin Kosnik  <bkoz@redhat.com>
 
-       * include/std/stdexcept: Remove extra spacing.
-
-        * testsuite/19_diagnostics/stdexceptions.cc: Break into...
-        * testsuite/19_diagnostics/bad_exception: ...this. Populate.
-        * testsuite/19_diagnostics/logic_error: ... this.
-        * testsuite/19_diagnostics/logic_error/what-1.cc: ...this.
-        * testsuite/19_diagnostics/logic_error/what-2.cc: ...this.
-        * testsuite/19_diagnostics/runtime_error: ...this.
-        * testsuite/19_diagnostics/runtime_error/what-1.cc: ...this.
-        * testsuite/19_diagnostics/runtime_error/what-2.cc: ...this.
-        * testsuite/19_diagnostics/runtime_error/what-3.cc: ...this.
-        * testsuite/19_diagnostics/23591_thread-1.c: Move...
-        * testsuite/19_diagnostics/bad_exception/23591_thread-1.c: ...here.
+       * include/std/stdexcept: Remove extra spacing.
+
+       * testsuite/19_diagnostics/stdexceptions.cc: Break into...
+       * testsuite/19_diagnostics/bad_exception: ...this. Populate.
+       * testsuite/19_diagnostics/logic_error: ... this.
+       * testsuite/19_diagnostics/logic_error/what-1.cc: ...this.
+       * testsuite/19_diagnostics/logic_error/what-2.cc: ...this.
+       * testsuite/19_diagnostics/runtime_error: ...this.
+       * testsuite/19_diagnostics/runtime_error/what-1.cc: ...this.
+       * testsuite/19_diagnostics/runtime_error/what-2.cc: ...this.
+       * testsuite/19_diagnostics/runtime_error/what-3.cc: ...this.
+       * testsuite/19_diagnostics/23591_thread-1.c: Move...
+       * testsuite/19_diagnostics/bad_exception/23591_thread-1.c: ...here.
 
 2007-05-10  Paolo Carlini  <pcarlini@suse.de>
 
index b50bd35d67e89f3cb3386975c3e7c48f2d65ffb4..ebd83219af3d1d79798d7d26a4830de358fb4228 100644 (file)
@@ -37,6 +37,7 @@
 #include <locale>
 #include <bits/c++locale_internal.h>
 #include <cstdlib>
+#include <cstring>
 
 namespace std
 {
index ae1fa2899f57c2bdc78cd8e8025280f2f1d0fad9..732b60955f4a98abd82410edcea40e949df0b66d 100644 (file)
 #include <cerrno>  // For errno
 #include <cmath>  // For isinf, finite, finitef, fabs
 #include <cstdlib>  // For strof, strtold
+#include <cstring>
 #include <locale>
 #include <limits>
+#include <cstddef>
 
 #ifdef _GLIBCXX_HAVE_IEEEFP_H
 #include <ieeefp.h>
@@ -53,7 +55,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                   const __c_locale&)         
     {
       // Assumes __s formatted for "C" locale.
-      char* __old = strdup(setlocale(LC_ALL, NULL));
+      char* __old = setlocale(LC_ALL, NULL);
+      const size_t __len = strlen(__old) + 1;
+      char* __sav = new char[__len];
+      memcpy(__sav, __old, __len);
       setlocale(LC_ALL, "C");
       char* __sanity;
 
@@ -91,8 +96,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       else
        __err |= ios_base::failbit;
 
-      setlocale(LC_ALL, __old);
-      free(__old);
+      setlocale(LC_ALL, __sav);
+      delete [] __sav;
     }
 
   template<>
@@ -101,7 +106,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                   const __c_locale&) 
     {
       // Assumes __s formatted for "C" locale.
-      char* __old = strdup(setlocale(LC_ALL, NULL));
+      char* __old = setlocale(LC_ALL, NULL);
+      const size_t __len = strlen(__old) + 1;
+      char* __sav = new char[__len];
+      memcpy(__sav, __old, __len);
       setlocale(LC_ALL, "C");
       char* __sanity;
 
@@ -121,8 +129,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       else
        __err |= ios_base::failbit;
 
-      setlocale(LC_ALL, __old);
-      free(__old);
+      setlocale(LC_ALL, __sav);
+      delete [] __sav;
     }
 
   template<>
@@ -131,7 +139,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                   ios_base::iostate& __err, const __c_locale&) 
     {
       // Assumes __s formatted for "C" locale.
-      char* __old = strdup(setlocale(LC_ALL, NULL));
+      char* __old = setlocale(LC_ALL, NULL);
+      const size_t __len = strlen(__old) + 1;
+      char* __sav = new char[__len];
+      memcpy(__sav, __old, __len);
       setlocale(LC_ALL, "C");
 
 #if !__LDBL_HAS_INFINITY__
@@ -167,8 +178,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       else
        __err |= ios_base::failbit;
 
-      setlocale(LC_ALL, __old);
-      free(__old);
+      setlocale(LC_ALL, __sav);
+      delete [] __sav;
     }
 
   void
index 1b7fc6ddb10140b87b5108acb499879850fc2cb0..c5e3f25d8861b83ba7be1169b76a9861a5f4d24f 100644 (file)
@@ -1,6 +1,6 @@
 // Wrapper for underlying C-language localization -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -45,9 +45,9 @@
 #pragma GCC system_header
 
 #include <clocale>
-#include <cstring>   // get std::strlen
 #include <cstdio>    // get std::vsnprintf or std::vsprintf
 #include <cstdarg>
+#include <cstddef>
 
 #define _GLIBCXX_NUM_CATEGORIES 0
 
@@ -66,10 +66,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   {
     char* __old = std::setlocale(LC_NUMERIC, NULL);
     char* __sav = NULL;
-    if (std::strcmp(__old, "C"))
+    if (__builtin_strcmp(__old, "C"))
       {
-       __sav = new char[std::strlen(__old) + 1];
-       std::strcpy(__sav, __old);
+       const size_t __len = __builtin_strlen(__old) + 1;
+       __sav = new char[__len];
+       __builtin_memcpy(__sav, __old, __len);
        std::setlocale(LC_NUMERIC, "C");
       }
 
index 7b03b5b60ba4f4ae86ac1f6d8dd1d85f83667039..da4448d00e5a9a7524472931869b9a3a6ddf1adf 100644 (file)
@@ -37,6 +37,7 @@
 #include <locale>
 #include <cstdlib>  // For MB_CUR_MAX
 #include <climits>  // For MB_LEN_MAX
+#include <cstring>
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
index f614037a23882ca7945a34de11dd4319b3abacd9..6f3115d3637e500acdde4dcac1347035bfa361c0 100644 (file)
@@ -1,6 +1,7 @@
 // std::collate implementation details, generic version -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -34,6 +35,7 @@
 // Written by Benjamin Kosnik <bkoz@redhat.com>
 
 #include <locale>
+#include <cstring>
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
index 3c7209d65fb16a81e70b5109cbc952d745047325..ae1c7cf1d0fd59aa18f9fedcd31460f9e3cfce54 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <locale>
 #include <cstdlib>
+#include <cstring>
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
index 40986886e8bb827c38d1699c1535377dfc867c93..f82f2f2b6460429065ee1c51023af9ae1bae7f62 100644 (file)
@@ -1,6 +1,7 @@
 // std::messages implementation details, generic version -*- C++ -*-
 
-// Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -83,7 +84,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
      messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
      : messages<_CharT>(__refs) 
      { 
-       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+       if (__builtin_strcmp(__s, "C") != 0
+           && __builtin_strcmp(__s, "POSIX") != 0)
          {
            this->_S_destroy_c_locale(this->_M_c_locale_messages);
            this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
index b8ebb746b1b6c4002ece0150dcbab533f96d6aaf..08fd7a1be4f6ec385cadd8f169ae4ec771c648d8 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <locale>
 #include <cstdlib>
+#include <cstring>
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
@@ -46,11 +47,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     _M_put(char* __s, size_t __maxlen, const char* __format, 
           const tm* __tm) const
     {
-      char* __old = strdup(setlocale(LC_ALL, NULL));
+      char* __old = setlocale(LC_ALL, NULL);
+      const size_t __llen = strlen(__old) + 1;
+      char* __sav = new char[__llen];
+      memcpy(__sav, __old, __llen);
       setlocale(LC_ALL, _M_name_timepunct);
       const size_t __len = strftime(__s, __maxlen, __format, __tm);
-      setlocale(LC_ALL, __old);
-      free(__old);
+      setlocale(LC_ALL, __sav);
+      delete [] __sav;
       // Make sure __s is null terminated.
       if (__len == 0)
        __s[0] = '\0';
@@ -128,11 +132,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
           const tm* __tm) const
     {
-      char* __old = strdup(setlocale(LC_ALL, NULL));
+      char* __old = setlocale(LC_ALL, NULL);
+      const size_t __llen = strlen(__old) + 1;
+      char* __sav = new char[__llen];
+      memcpy(__sav, __old, __llen);
       setlocale(LC_ALL, _M_name_timepunct);
       const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
-      setlocale(LC_ALL, __old);
-      free(__old);
+      setlocale(LC_ALL, __sav);
+      delete [] __sav;
       // Make sure __s is null terminated.
       if (__len == 0)
        __s[0] = L'\0';      
index 8c868c01495619963ba9914eeb8b7222060cdaaf..dc387691d9a99beca6bbc977fd3e63658f4b2437 100644 (file)
@@ -1,6 +1,7 @@
 // std::time_get, std::time_put implementation, generic version -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -62,9 +63,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                                     size_t __refs) 
     : facet(__refs), _M_data(NULL)
     { 
-      const size_t __len = std::strlen(__s) + 1;
+      const size_t __len = __builtin_strlen(__s) + 1;
       char* __tmp = new char[__len];
-      std::memcpy(__tmp, __s, __len);
+      __builtin_memcpy(__tmp, __s, __len);
       _M_name_timepunct = __tmp;
 
       try
index cbce1690f46c2f90b27730e4bc6e4cddff248a7a..80a1df92d9c4872e1ff34bf9b4b4e85e7a081cb3 100644 (file)
@@ -38,6 +38,8 @@
 #include <bits/c++config.h>
 #include <clocale>
 #include <cstdlib>
+#include <cstring>
+#include <cstddef>
 #include <langinfo.h>
 
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
index 7a71b013eeee8087bea5e76b4cdb971207f365ba..0e1aa760f249f8cc35ca6c150bcd08aa33d40bff 100644 (file)
 
 #pragma GCC system_header
 
-#include <cstring>              // get std::strlen
 #include <cstdio>               // get std::vsnprintf or std::vsprintf
 #include <clocale>
 #include <libintl.h>           // For messages
 #include <cstdarg>
+#include <cstddef>
 
 #define _GLIBCXX_C_LOCALE_GNU 1
 
@@ -80,8 +80,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 #else
     char* __old = std::setlocale(LC_ALL, NULL);
-    char* __sav = new char[std::strlen(__old) + 1];
-    std::strcpy(__sav, __old);
+    const size_t __len = __builtin_strlen(__old) + 1;
+    char* __sav = new char[__len];
+    __builtin_memcpy(__sav, __old, __len);
     std::setlocale(LC_ALL, "C");
 #endif
 
index f206e44a636b34eb857fb33e845a6c93e82e1a30..cbecc56225bb466606b3d472a1e17b3a1d9adb41 100644 (file)
@@ -49,11 +49,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       __uselocale(__old);
       return string(__msg);
 #else
-      char* __old = strdup(setlocale(LC_ALL, NULL));
+      char* __old = setlocale(LC_ALL, NULL);
+      const size_t __len = strlen(__old) + 1;
+      char* __sav = new char[__len];
+      memcpy(__sav, __old, __len);
       setlocale(LC_ALL, _M_name_messages);
       const char* __msg = gettext(__dfault.c_str());
-      setlocale(LC_ALL, __old);
-      free(__old);
+      setlocale(LC_ALL, __sav);
+      delete [] __sav;
       return string(__msg);
 #endif
     }
@@ -69,11 +72,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       __uselocale(__old);
       return _M_convert_from_char(__msg);
 # else
-      char* __old = strdup(setlocale(LC_ALL, NULL));
+      char* __old = setlocale(LC_ALL, NULL);
+      const size_t __len = strlen(__old) + 1;
+      char* __sav = new char[__len];
+      memcpy(__sav, __old, __len);
       setlocale(LC_ALL, _M_name_messages);
       char* __msg = gettext(_M_convert_to_char(__dfault));
-      setlocale(LC_ALL, __old);
-      free(__old);
+      setlocale(LC_ALL, __sav);
+      delete [] __sav;
       return _M_convert_from_char(__msg);
 # endif
     }
index 31504e58bdc73d6e952825ca22948c03b66e3bad..21e4ccb0626213c32d0262b33d638669fcc336f1 100644 (file)
@@ -1,6 +1,7 @@
 // std::messages implementation details, GNU version -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -52,9 +53,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                                size_t __refs) 
      : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
      {
-       const size_t __len = std::strlen(__s) + 1;
+       const size_t __len = __builtin_strlen(__s) + 1;
        char* __tmp = new char[__len];
-       std::memcpy(__tmp, __s, __len);
+       __builtin_memcpy(__tmp, __s, __len);
        _M_name_messages = __tmp;
 
        // Last to avoid leaking memory if new throws.
@@ -102,11 +103,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
      { 
        if (this->_M_name_messages != locale::facet::_S_get_c_name())
         delete [] this->_M_name_messages;
-       char* __tmp = new char[std::strlen(__s) + 1];
-       std::strcpy(__tmp, __s);
+       const size_t __len = __builtin_strlen(__s) + 1;
+       char* __tmp = new char[__len];
+       __builtin_memcpy(__tmp, __s, __len);
        this->_M_name_messages = __tmp;
 
-       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+       if (__builtin_strcmp(__s, "C") != 0
+          && __builtin_strcmp(__s, "POSIX") != 0)
         {
           this->_S_destroy_c_locale(this->_M_c_locale_messages);
           this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
index 9a417741e6a6cd14d97b945526b293109084815b..28683b5fae4cf1c756e7752d555df65a02f1874f 100644 (file)
@@ -383,7 +383,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
          __c_locale __old = __uselocale(__cloc);
 #else
          // Switch to named locale so that mbsrtowcs will work.
-         char* __old = strdup(setlocale(LC_ALL, NULL));
+         char* __old = setlocale(LC_ALL, NULL);
+          const size_t __llen = strlen(__old) + 1;
+          char* __sav = new char[__llen];
+          memcpy(__sav, __old, __llen);
          setlocale(LC_ALL, __name);
 #endif
 
@@ -457,8 +460,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
              __uselocale(__old);
 #else
-             setlocale(LC_ALL, __old);
-             free(__old);
+             setlocale(LC_ALL, __sav);
+             delete [] __sav;
 #endif
              __throw_exception_again;
            } 
@@ -478,8 +481,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
          __uselocale(__old);
 #else
-         setlocale(LC_ALL, __old);
-         free(__old);
+         setlocale(LC_ALL, __sav);
+         delete [] __sav;
 #endif
        }
     }
@@ -525,7 +528,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
          __c_locale __old = __uselocale(__cloc);
 #else
          // Switch to named locale so that mbsrtowcs will work.
-         char* __old = strdup(setlocale(LC_ALL, NULL));
+         char* __old = setlocale(LC_ALL, NULL);
+          const size_t __llen = strlen(__old) + 1;
+          char* __sav = new char[__llen];
+          memcpy(__sav, __old, __llen);
          setlocale(LC_ALL, __name);
 #endif
 
@@ -600,8 +606,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
              __uselocale(__old);
 #else
-             setlocale(LC_ALL, __old);
-             free(__old);
+             setlocale(LC_ALL, __sav);
+             delete [] __sav;
 #endif
               __throw_exception_again;
            }
@@ -620,8 +626,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
          __uselocale(__old);
 #else
-         setlocale(LC_ALL, __old);
-         free(__old);
+         setlocale(LC_ALL, __sav);
+         delete [] __sav;
 #endif
        }
     }
index 10faa8fe47022e1621e4d2452589b2fc270f691a..3c9a61fabaa0b32f75ad2aeef673e8b765f33247 100644 (file)
@@ -1,6 +1,7 @@
 // std::time_get, std::time_put implementation, GNU version -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -49,11 +50,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
                                        _M_c_locale_timepunct);
 #else
-      char* __old = strdup(setlocale(LC_ALL, NULL));
+      char* __old = setlocale(LC_ALL, NULL);
+      const size_t __llen = strlen(__old) + 1;  
+      char* __sav = new char[__llen];
+      memcpy(__sav, __old, __llen);
       setlocale(LC_ALL, _M_name_timepunct);
       const size_t __len = strftime(__s, __maxlen, __format, __tm);
-      setlocale(LC_ALL, __old);
-      free(__old);
+      setlocale(LC_ALL, __sav);
+      delete [] __sav;
 #endif
       // Make sure __s is null terminated.
       if (__len == 0)
@@ -202,11 +206,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
                                        _M_c_locale_timepunct);
 #else
-      char* __old = strdup(setlocale(LC_ALL, NULL));
+      char* __old = setlocale(LC_ALL, NULL);
+      const size_t __llen = strlen(__old) + 1;
+      char* __sav = new char[__llen];
+      memcpy(__sav, __old, __llen);
       setlocale(LC_ALL, _M_name_timepunct);
       const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
-      setlocale(LC_ALL, __old);
-      free(__old);
+      setlocale(LC_ALL, __sav);
+      delete [] __sav;
 #endif
       // Make sure __s is null terminated.
       if (__len == 0)
index b03aa57561d390da5c0a384393cf67df8a19a3cb..7f97bcbbd7b45433d01e8c3b5945d1e52309b72b 100644 (file)
@@ -1,6 +1,7 @@
 // std::time_get, std::time_put implementation, GNU version -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -59,9 +60,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
       _M_name_timepunct(NULL)
     { 
-      const size_t __len = std::strlen(__s) + 1;
+      const size_t __len = __builtin_strlen(__s) + 1;
       char* __tmp = new char[__len];
-      std::memcpy(__tmp, __s, __len);
+      __builtin_memcpy(__tmp, __s, __len);
       _M_name_timepunct = __tmp;
 
       try
index 0b895e2956ed7975d9eb3471e0d2eaf000b66dd3..779b26a0d492e368559781513798cc0fcd43e1dd 100644 (file)
@@ -1,6 +1,7 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
   ctype<char>::classic_table() throw()
   {
     const ctype_base::mask* __ret;
-    char* __old = strdup(setlocale(LC_CTYPE, NULL));
+    char* __old = setlocale(LC_CTYPE, NULL);
+    const size_t __len = __builtin_strlen(__old) + 1;
+    char* __sav = new char[__len];
+    __builtin_memcpy(__sav, __old, __len);
     setlocale(LC_CTYPE, "C");
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
     __ret = *__ctype_b_loc();
 #else
     __ret = __ctype_b;
 #endif
-    setlocale(LC_CTYPE, __old);
-    free(__old);
+    setlocale(LC_CTYPE, __sav);
+    delete [] __sav;
     return __ret;
   }
 #endif
@@ -71,8 +75,8 @@
   _M_table(__table ? __table : _M_c_locale_ctype->__ctype_b), 
   _M_widen_ok(0), _M_narrow_ok(0) 
   {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    memset(_M_narrow, 0, sizeof(_M_narrow));
+    __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+    __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
   }
 #else
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
   : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
   _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
   {
-    char* __old=strdup(setlocale(LC_CTYPE, NULL));
+    char* __old = setlocale(LC_CTYPE, NULL);
+    const size_t __len = __builtin_strlen(__old) + 1;
+    char* __sav = new char[__len];
+    __builtin_memcpy(__sav, __old, __len);    
     setlocale(LC_CTYPE, "C");
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
     _M_toupper = *__ctype_toupper_loc();
     _M_tolower = __ctype_tolower;
     _M_table = __table ? __table : __ctype_b;
 #endif
-    setlocale(LC_CTYPE, __old);
-    free(__old);
-    memset(_M_widen, 0, sizeof(_M_widen));
-    memset(_M_narrow, 0, sizeof(_M_narrow));
+    setlocale(LC_CTYPE, __sav);
+    delete [] __sav;
+    __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+    __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
   }
 #endif
 
   _M_table(__table ? __table : _M_c_locale_ctype->__ctype_b), 
   _M_widen_ok(0), _M_narrow_ok(0) 
   {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    memset(_M_narrow, 0, sizeof(_M_narrow));
+    __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+    __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
   }
 #else
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
   : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), 
   _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
   {
-    char* __old=strdup(setlocale(LC_CTYPE, NULL));
+    char* __old = setlocale(LC_CTYPE, NULL);
+    const size_t __len = __builtin_strlen(__old) + 1;
+    char* __sav = new char[__len];
+    __builtin_memcpy(__sav, __old, __len);
     setlocale(LC_CTYPE, "C");
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
     _M_toupper = *__ctype_toupper_loc();
     _M_tolower = __ctype_tolower;
     _M_table = __table ? __table : __ctype_b;
 #endif
-    setlocale(LC_CTYPE, __old);
-    free(__old);
-    memset(_M_widen, 0, sizeof(_M_widen));
-    memset(_M_narrow, 0, sizeof(_M_narrow));
+    setlocale(LC_CTYPE, __sav);
+    delete [] __sav;
+    __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+    __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
   }
 #endif
 
index 3a42ba085c67ce34e27bb5a630f52efe0c8f0ba1..e2136742456e3a478d5073b730fba9df255a4e41 100644 (file)
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007 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
   ctype<char>::classic_table() throw()
   {
     const ctype_base::mask* __ret;
-    char* __old = strdup(setlocale(LC_CTYPE, NULL));
+    char* __old = setlocale(LC_CTYPE, NULL);
+    const size_t __len = __builtin_strlen(__old) + 1;
+    char* __sav = new char[__len];
+    __builtin_memcpy(__sav, __old, __len);
     setlocale(LC_CTYPE, "C");
     __ret = *__ctype_b_loc();
-    setlocale(LC_CTYPE, __old);
-    free(__old);
+    setlocale(LC_CTYPE, __sav);
+    delete [] __sav;
     return __ret;
   }
 
                     size_t __refs) 
   : facet(__refs), _M_del(__table != 0 && __del)
   {
-    char* __old=strdup(setlocale(LC_CTYPE, NULL));
+    char* __old = setlocale(LC_CTYPE, NULL);
+    const size_t __len = __builtin_strlen(__old) + 1;
+    char* __sav = new char[__len];
+    __builtin_memcpy(__sav, __old, __len);
     setlocale(LC_CTYPE, "C");
     _M_toupper = *__ctype_toupper_loc();
     _M_tolower = *__ctype_tolower_loc();
     _M_table = __table ? __table : *__ctype_b_loc();
-    setlocale(LC_CTYPE, __old);
-    free(__old);
+    setlocale(LC_CTYPE, __sav);
+    delete [] __sav;
     _M_c_locale_ctype = _S_get_c_locale();
   }
 
   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
   : facet(__refs), _M_del(__table != 0 && __del)
   {
-    char* __old=strdup(setlocale(LC_CTYPE, NULL));
+    char* __old = setlocale(LC_CTYPE, NULL);
+    const size_t __len = __builtin_strlen(__old) + 1;
+    char* __sav = new char[__len];
+    __builtin_memcpy(__sav, __old, __len);
     setlocale(LC_CTYPE, "C");
     _M_toupper = *__ctype_toupper_loc();
     _M_tolower = *__ctype_tolower_loc();
     _M_table = __table ? __table : *__ctype_b_loc();
-    setlocale(LC_CTYPE, __old);
-    free(__old);
+    setlocale(LC_CTYPE, __sav);
+    delete [] __sav;
     _M_c_locale_ctype = _S_get_c_locale();
   }
 
index 03d744c643ac5c8c66f9d12f6842bfe5878e52d1..a4b4e3a0d64791e84e8cacdfe2ed2f1295b4d6dd 100644 (file)
@@ -43,7 +43,6 @@
 
 #pragma GCC system_header
 
-#include <cstring>              // For memmove, memset, memchr
 #include <bits/stl_algobase.h>  // For copy, fill_n
 #include <bits/postypes.h>      // For streampos
 #include <cstdio>               // For EOF
@@ -186,8 +185,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
     char_traits<_CharT>::
     move(char_type* __s1, const char_type* __s2, std::size_t __n)
     {
-      return static_cast<_CharT*>(std::memmove(__s1, __s2,
-                                              __n * sizeof(char_type)));
+      return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
+                                                   __n * sizeof(char_type)));
     }
 
   template<typename _CharT>
@@ -254,27 +253,27 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
       static int
       compare(const char_type* __s1, const char_type* __s2, size_t __n)
-      { return memcmp(__s1, __s2, __n); }
+      { return __builtin_memcmp(__s1, __s2, __n); }
 
       static size_t
       length(const char_type* __s)
-      { return strlen(__s); }
+      { return __builtin_strlen(__s); }
 
       static const char_type*
       find(const char_type* __s, size_t __n, const char_type& __a)
-      { return static_cast<const char_type*>(memchr(__s, __a, __n)); }
+      { return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); }
 
       static char_type*
       move(char_type* __s1, const char_type* __s2, size_t __n)
-      { return static_cast<char_type*>(memmove(__s1, __s2, __n)); }
+      { return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n)); }
 
       static char_type*
       copy(char_type* __s1, const char_type* __s2, size_t __n)
-      { return static_cast<char_type*>(memcpy(__s1, __s2, __n)); }
+      { return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n)); }
 
       static char_type*
       assign(char_type* __s, size_t __n, char_type __a)
-      { return static_cast<char_type*>(memset(__s, __a, __n)); }
+      { return static_cast<char_type*>(__builtin_memset(__s, __a, __n)); }
 
       static char_type
       to_char_type(const int_type& __c)
index 930c798331a7f3cbc0733f82777c9967a42c0ebf..d8d33070ff7fb93feaabe952d70e852c23a0f69f 100644 (file)
@@ -457,7 +457,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       codecvt_byname(const char* __s, size_t __refs = 0)
       : codecvt<_InternT, _ExternT, _StateT>(__refs)
       {
-       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+       if (__builtin_strcmp(__s, "C") != 0
+           && __builtin_strcmp(__s, "POSIX") != 0)
          {
            this->_S_destroy_c_locale(this->_M_c_locale_codecvt);
            this->_S_create_c_locale(this->_M_c_locale_codecvt, __s);
index 2653d6f65708a3b33e91cbd3ed2e08de722ebed3..28dde161490492bf94ec8b5fe75165481b7d6ee7 100644 (file)
@@ -263,14 +263,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                {
                  char* __buf = new char[__blen];
                  if (__remainder)
-                   std::memcpy(__buf, _M_ext_next, __remainder);
+                   __builtin_memcpy(__buf, _M_ext_next, __remainder);
 
                  delete [] _M_ext_buf;
                  _M_ext_buf = __buf;
                  _M_ext_buf_size = __blen;
                }
              else if (__remainder)
-               std::memmove(_M_ext_buf, _M_ext_next, __remainder);
+               __builtin_memmove(_M_ext_buf, _M_ext_next, __remainder);
 
              _M_ext_next = _M_ext_buf;
              _M_ext_end = _M_ext_buf + __remainder;
@@ -888,7 +888,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                                             this->gptr() - this->eback());
                      const streamsize __remainder = _M_ext_end - _M_ext_next;
                      if (__remainder)
-                       std::memmove(_M_ext_buf, _M_ext_next, __remainder);
+                       __builtin_memmove(_M_ext_buf, _M_ext_next, __remainder);
 
                      _M_ext_next = _M_ext_buf;
                      _M_ext_end = _M_ext_buf + __remainder;
index 5e6a8105d8bb4e70005afc6b9d8ca9a2e575c607..60de269567701894cc7984807ddba0882535f1d3 100644 (file)
@@ -44,7 +44,6 @@
 #pragma GCC system_header
 
 #include <bits/localefwd.h>
-#include <cstring>             // For strcmp.
 #include <string>
 #include <ext/atomicity.h>
 
@@ -537,7 +536,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       if (_M_names[1])
        // We must actually compare all the _M_names: can be all equal!
        for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i)
-         __ret = std::strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
+         __ret = __builtin_strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
       return __ret;
     }
 
@@ -810,7 +809,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       collate_byname(const char* __s, size_t __refs = 0)
       : collate<_CharT>(__refs)
       {
-       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+       if (__builtin_strcmp(__s, "C") != 0
+           && __builtin_strcmp(__s, "POSIX") != 0)
          {
            this->_S_destroy_c_locale(this->_M_c_locale_collate);
            this->_S_create_c_locale(this->_M_c_locale_collate, __s);
index 42865a69c3773616c7fcefadb4a759db969e4039..7a89927faddc8b0d48c8bd03be7b8529d076d74c 100644 (file)
@@ -899,7 +899,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       {
        if (_M_widen_ok == 1)
          {
-           memcpy(__to, __lo, __hi - __lo);
+           __builtin_memcpy(__to, __lo, __hi - __lo);
            return __hi;
          }
        if (!_M_widen_ok)
@@ -964,7 +964,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       {
        if (__builtin_expect(_M_narrow_ok == 1, true))
          {
-           memcpy(__to, __lo, __hi - __lo);
+           __builtin_memcpy(__to, __lo, __hi - __lo);
            return __hi;
          }
        if (!_M_narrow_ok)
@@ -1101,7 +1101,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       virtual const char*
       do_widen(const char* __lo, const char* __hi, char_type* __dest) const
       {
-       memcpy(__dest, __lo, __hi - __lo);
+       __builtin_memcpy(__dest, __lo, __hi - __lo);
        return __hi;
       }
 
@@ -1154,7 +1154,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       do_narrow(const char_type* __lo, const char_type* __hi,
                char, char* __dest) const
       {
-       memcpy(__dest, __lo, __hi - __lo);
+       __builtin_memcpy(__dest, __lo, __hi - __lo);
        return __hi;
       }
 
@@ -1169,7 +1169,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
        _M_widen_ok = 1;
        // Set _M_widen_ok to 2 if memcpy can't be used.
-       if (memcmp(__tmp, _M_widen, sizeof(_M_widen)))
+       if (__builtin_memcmp(__tmp, _M_widen, sizeof(_M_widen)))
          _M_widen_ok = 2;
       }
 
@@ -1184,7 +1184,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        do_narrow(__tmp, __tmp + sizeof(__tmp), 0, _M_narrow);
 
        _M_narrow_ok = 1;
-       if (memcmp(__tmp, _M_narrow, sizeof(_M_narrow)))
+       if (__builtin_memcmp(__tmp, _M_narrow, sizeof(_M_narrow)))
          _M_narrow_ok = 2;
        else
          {
@@ -1922,7 +1922,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       numpunct_byname(const char* __s, size_t __refs = 0)
       : numpunct<_CharT>(__refs)
       {
-       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+       if (__builtin_strcmp(__s, "C") != 0
+           && __builtin_strcmp(__s, "POSIX") != 0)
          {
            __c_locale __tmp;
            this->_S_create_c_locale(__tmp, __s);
index 15de0834fbee12471d637342324ccdc921f104b5..31c90e3b43cb5e0b73393c4df833ec4c4e9c7f29 100644 (file)
@@ -1320,7 +1320,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       moneypunct_byname(const char* __s, size_t __refs = 0)
       : moneypunct<_CharT, _Intl>(__refs)
       {
-       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+       if (__builtin_strcmp(__s, "C") != 0
+           && __builtin_strcmp(__s, "POSIX") != 0)
          {
            __c_locale __tmp;
            this->_S_create_c_locale(__tmp, __s);
index ab3d99e12efe62a2bd9f5deb3967d039af4e810a..64bd7df4b59939d7951992dabd023b29a62e4701 100644 (file)
@@ -140,8 +140,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       static char_type*
       move(char_type* __s1, const char_type* __s2, size_t __n)
       { 
-       return static_cast<char_type*>(std::memmove(__s1, __s2, 
-                                                   __n * sizeof(char_type))); 
+       return static_cast<char_type*>
+         (__builtin_memmove(__s1, __s2, __n * sizeof(char_type)));
       }
 
       static char_type*
index 61cad289b55d197290402a0bca4e8647972fb2e1..9ead05915dc81159a955a3a49b2a23dcd23bde40 100644 (file)
@@ -51,7 +51,6 @@
 #pragma GCC system_header
 
 #include <cstddef>     // For size_t
-#include <cstring>     // For memset
 #include <string>
 #include <bits/functexcept.h>   // For invalid_argument, out_of_range,
                                 // overflow_error
@@ -165,7 +164,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
 
       void
       _M_do_reset()
-      { std::memset(_M_w, 0, _Nw * sizeof(_WordT)); }
+      { __builtin_memset(_M_w, 0, _Nw * sizeof(_WordT)); }
 
       bool
       _M_is_equal(const _Base_bitset<_Nw>& __x) const
index 4a2e896f7bbc7c03557c2ae175752f1bd29044b3..a77e8e5b010926941bb8032fb77aa4842b9220e5 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <locale>
 #include <cstdlib>
+#include <cstring>
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
index f8245ecb6284d23fcd75dd19cc171ca782a9c438..d5e36d2df84d2d07746f755cc8d6149245fa8cc3 100644 (file)
@@ -1,6 +1,7 @@
 // 2001-02-26 Benjamin Kosnik  <bkoz@redhat.com>
 
-// Copyright (C) 2001, 2002, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -22,6 +23,7 @@
 
 #include <string>
 #include <stdexcept>
+#include <cstring>
 #include <testsuite_hooks.h>
 
 // libstdc++/1972
index 7b8077b100014bd7aa3112df484d334a7cc23938..030b5e8f61f50571660cee0dd1e638e3d986c70c 100644 (file)
@@ -1,6 +1,7 @@
 // 2001-02-26 Benjamin Kosnik  <bkoz@redhat.com>
 
-// Copyright (C) 2001, 2002, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -22,6 +23,7 @@
 
 #include <string>
 #include <stdexcept>
+#include <cstring>
 #include <testsuite_hooks.h>
 
 // libstdc++/2089
index 64fd201b7a2d4d353c27bb4b3c6008d3e982becf..a46a421db2eaee86a7ecf70297c6edb55179b7ce 100644 (file)
@@ -1,6 +1,7 @@
 // 2001-02-26 Benjamin Kosnik  <bkoz@redhat.com>
 
-// Copyright (C) 2001, 2002, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -22,6 +23,7 @@
 
 #include <string>
 #include <stdexcept>
+#include <cstring>
 #include <testsuite_hooks.h>
 
 // libstdc++/1972
index 49c56e2d5c4abd333adeb5a45ff736c330ab31e3..779c1f518067bec9e8e8d6c83ce975c3a86559e8 100644 (file)
@@ -1,6 +1,7 @@
 // 2001-02-26 Benjamin Kosnik  <bkoz@redhat.com>
 
-// Copyright (C) 2001, 2002, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -22,6 +23,7 @@
 
 #include <string>
 #include <stdexcept>
+#include <cstring>
 #include <testsuite_hooks.h>
 
 // libstdc++/2089
index 31560877fd47563c0b5348dc84158bd632eec3bd..04b85c0c5fe9db00f5601bbfe357af5a2036105e 100644 (file)
@@ -1,6 +1,7 @@
 // 2001-02-26 Benjamin Kosnik  <bkoz@redhat.com>
 
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -22,6 +23,7 @@
 
 #include <string>
 #include <stdexcept>
+#include <cstring>
 #include <testsuite_hooks.h>
 
 // test copy ctors and assignment operators