]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/config/os/aix/ctype_inline.h
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / config / os / aix / ctype_inline.h
index 03f1f3644846158ebcc2b22f068fafdd11f9bacd..2f31914c318f56b1ac7acd514ba62408128fd44f 100644 (file)
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 2000, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2000-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
 // ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
 // functions go in ctype.cc
 
-_GLIBCXX_BEGIN_NAMESPACE(std)
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   bool
   ctype<char>::
   is(mask __m, char __c) const
-  { return __OBJ_DATA(__lc_ctype)->mask[__c] & __m; }
+  {
+    if(_M_table)
+      return _M_table[static_cast<unsigned char>(__c)] & __m;
+    else
+#ifdef _THREAD_SAFE
+      return __OBJ_DATA((*__lc_ctype_ptr))->mask[static_cast<unsigned char>(__c)] & __m;
+#else
+      return __OBJ_DATA(__lc_ctype)->mask[static_cast<unsigned char>(__c)] & __m;
+#endif
+  }
 
   const char*
   ctype<char>::
   is(const char* __low, const char* __high, mask* __vec) const
   {
-    while (__low < __high)
-      *__vec++ = __OBJ_DATA(__lc_ctype)->mask[*__low++];
+    if(_M_table)
+      while (__low < __high)
+       *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
+    else
+      while (__low < __high)
+#ifdef _THREAD_SAFE
+       *__vec++ = __OBJ_DATA((*__lc_ctype_ptr))->mask[static_cast<unsigned char>(*__low++)];
+#else
+        *__vec++ = __OBJ_DATA(__lc_ctype)->mask[static_cast<unsigned char>(*__low++)];
+#endif
     return __high;
   }
 
@@ -68,4 +87,5 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     return __low;
   }
 
-_GLIBCXX_END_NAMESPACE
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace