Fix build for UCLIBC platforms (newlocale/freelocale)
UCLIBC does not have locale support by default. BUG=skia: Review URL: https://codereview.chromium.org/1162953003
This commit is contained in:
parent
257918898a
commit
1aca864904
@ -28,7 +28,7 @@ public:
|
|||||||
#if defined(SK_BUILD_FOR_WIN)
|
#if defined(SK_BUILD_FOR_WIN)
|
||||||
fOldPerThreadLocale = _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
|
fOldPerThreadLocale = _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
|
||||||
fOldLocale = setlocale(LC_ALL, name);
|
fOldLocale = setlocale(LC_ALL, name);
|
||||||
#elif !defined(SK_BUILD_FOR_ANDROID)
|
#elif !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__)
|
||||||
fLocale = newlocale(LC_ALL, name, 0);
|
fLocale = newlocale(LC_ALL, name, 0);
|
||||||
if (fLocale) {
|
if (fLocale) {
|
||||||
fOldLocale = uselocale(fLocale);
|
fOldLocale = uselocale(fLocale);
|
||||||
@ -42,7 +42,7 @@ public:
|
|||||||
#if defined(SK_BUILD_FOR_WIN)
|
#if defined(SK_BUILD_FOR_WIN)
|
||||||
setlocale(LC_ALL, fOldLocale);
|
setlocale(LC_ALL, fOldLocale);
|
||||||
_configthreadlocale(fOldPerThreadLocale);
|
_configthreadlocale(fOldPerThreadLocale);
|
||||||
#elif !defined(SK_BUILD_FOR_ANDROID)
|
#elif !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__)
|
||||||
if (fLocale) {
|
if (fLocale) {
|
||||||
uselocale(fOldLocale);
|
uselocale(fOldLocale);
|
||||||
freelocale(fLocale);
|
freelocale(fLocale);
|
||||||
@ -54,7 +54,7 @@ private:
|
|||||||
#if defined(SK_BUILD_FOR_WIN)
|
#if defined(SK_BUILD_FOR_WIN)
|
||||||
int fOldPerThreadLocale;
|
int fOldPerThreadLocale;
|
||||||
const char* fOldLocale;
|
const char* fOldLocale;
|
||||||
#elif !defined(SK_BUILD_FOR_ANDROID)
|
#elif !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__)
|
||||||
locale_t fOldLocale;
|
locale_t fOldLocale;
|
||||||
locale_t fLocale;
|
locale_t fLocale;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user