]> 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 14f22be1d866b0e359bc2328446ff2f34aee4544..2f31914c318f56b1ac7acd514ba62408128fd44f 100644 (file)
@@ -1,6 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 2000, 2009, 2010, 2011 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
@@ -41,11 +41,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   bool
   ctype<char>::
   is(mask __m, char __c) const
-  { 
+  {
     if(_M_table)
       return _M_table[static_cast<unsigned char>(__c)] & __m;
     else
-      return __OBJ_DATA(__lc_ctype)->mask[__c] & __m;
+#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*
@@ -57,7 +61,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
     else
       while (__low < __high)
-        *__vec++ = __OBJ_DATA(__lc_ctype)->mask[*__low++];
+#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;
   }