diff options
author | Brian Salomon <bsalomon@google.com> | 2017-01-05 10:37:24 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-01-05 17:26:43 +0000 |
commit | 4d5e65d19a82bf993e95f9986ce1d2b84cf22ff7 (patch) | |
tree | 2ce0e9945f2e48dc07d74aa054b9314ef22d4983 /src/gpu/GrAutoLocaleSetter.h | |
parent | 70120c778abc42ce754fb8178aa49bf8ce95a5c3 (diff) |
Use nullptr to indicate C locale when using xlocale
BUG=chromium:666228
Change-Id: I951102eba2b79ddaa5eb134834471a4a3ec8aed7
Reviewed-on: https://skia-review.googlesource.com/6603
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrAutoLocaleSetter.h')
-rw-r--r-- | src/gpu/GrAutoLocaleSetter.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gpu/GrAutoLocaleSetter.h b/src/gpu/GrAutoLocaleSetter.h index 564abd917f..cec041e086 100644 --- a/src/gpu/GrAutoLocaleSetter.h +++ b/src/gpu/GrAutoLocaleSetter.h @@ -20,6 +20,9 @@ #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) #include <xlocale.h> +#define HAVE_XLOCALE 1 +#else +#define HAVE_XLOCALE 0 #endif #if defined(SK_BUILD_FOR_ANDROID) || defined(__UCLIBC__) || defined(_NEWLIB_VERSION) @@ -45,6 +48,12 @@ public: fShouldRestoreLocale = false; } #elif HAVE_LOCALE_T +#if HAVE_XLOCALE + // In xlocale nullptr means the C locale. + if (0 == strcmp(name, "C")) { + name = nullptr; + } +#endif fLocale = newlocale(LC_ALL, name, 0); if (fLocale) { fOldLocale = uselocale(fLocale); @@ -82,5 +91,6 @@ private: }; #undef HAVE_LOCALE_T +#undef HAVE_XLOCALE #endif |