Drop global __ctype_ptr__ entirely in favor of using locale_t::ctype_ptr

Keep __ctype_ptr__ available on Cygwin only, for backward compatibility
with existing apps referencing it via the ctype macros.

Otherwise initialize __global_locale.ctype_ptr and __C_locale.ctype_ptr
and use them throughout.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2016-08-25 14:18:31 +02:00
parent 988629da1d
commit e97109184a
4 changed files with 37 additions and 41 deletions

View File

@@ -64,10 +64,10 @@ __set_ctype (struct __locale_t *loc, const char *charset)
}
ctype_ptr = (char *) _ctype_b;
}
if (loc)
loc->ctype_ptr = ctype_ptr + 127;
else
__ctype_ptr__ = ctype_ptr + 127;
loc->ctype_ptr = ctype_ptr + 127;
/* For backward compatibilty */
if (loc == __get_global_locale ())
__ctype_ptr__ = loc->ctype_ptr;
}
} /* extern "C" */