diff --git a/libstdc++-v3/config/os/aix/ctype_inline.h b/libstdc++-v3/config/os/aix/ctype_inline.h index 1faa19d8678..696fcfbf85a 100644 --- a/libstdc++-v3/config/os/aix/ctype_inline.h +++ b/libstdc++-v3/config/os/aix/ctype_inline.h @@ -45,7 +45,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if(_M_table) return _M_table[static_cast(__c)] & __m; else - return __OBJ_DATA(__lc_ctype)->mask[__c] & __m; +#ifdef _THREAD_SAFE + return __OBJ_DATA((*__lc_ctype_ptr))->mask[static_cast(__c)] & __m; +#else + return __OBJ_DATA(__lc_ctype)->mask[static_cast(__c)] & __m; +#endif } const char* @@ -57,7 +61,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION *__vec++ = _M_table[static_cast(*__low++)]; else while (__low < __high) - *__vec++ = __OBJ_DATA(__lc_ctype)->mask[*__low++]; +#ifdef _THREAD_SAFE + *__vec++ = __OBJ_DATA((*__lc_ctype_ptr))->mask[static_cast(*__low++)]; +#else + *__vec++ = __OBJ_DATA(__lc_ctype)->mask[static_cast(*__low++)]; +#endif return __high; }