]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/config/locale/generic/c_locale.h
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / config / locale / generic / c_locale.h
index 472ef55053048c7bdb21b2bca46aca6d4615c0b1..ef67a8de735a8441480b5adf1e83bb980796ea9e 100644 (file)
@@ -1,7 +1,6 @@
 // Wrapper for underlying C-language localization -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
-// Free Software Foundation, Inc.
+// Copyright (C) 2001-2024 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
@@ -23,9 +22,9 @@
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-/** @file c++locale.h
+/** @file bits/c++locale.h
  *  This is an internal header file, included by other library headers.
- *  You should not attempt to use it directly.
+ *  Do not attempt to use it directly. @headername{locale}
  */
 
 //
 #pragma GCC system_header
 
 #include <clocale>
-#include <cstddef>
 
 #define _GLIBCXX_NUM_CATEGORIES 0
 
-_GLIBCXX_BEGIN_NAMESPACE(std)
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   typedef int*                 __c_locale;
 
@@ -53,12 +53,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   // fall back to the unsafe vsprintf which, in general, can be dangerous
   // and should be avoided.
   inline int
-  __convert_from_v(const __c_locale&, char* __out, 
+  __convert_from_v(const __c_locale&, char* __out,
                   const int __size __attribute__((__unused__)),
                   const char* __fmt, ...)
   {
-    char* __old = std::setlocale(LC_NUMERIC, NULL);
-    char* __sav = NULL;
+    char* __old = std::setlocale(LC_NUMERIC, 0);
+    char* __sav = 0;
     if (__builtin_strcmp(__old, "C"))
       {
        const size_t __len = __builtin_strlen(__old) + 1;
@@ -70,7 +70,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     __builtin_va_list __args;
     __builtin_va_start(__args, __fmt);
 
-#ifdef _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_STDIO && !_GLIBCXX_HAVE_BROKEN_VSNPRINTF
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
 #else
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
@@ -86,6 +86,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     return __ret;
   }
 
-_GLIBCXX_END_NAMESPACE
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
 
 #endif