Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: src/gpu/GrAutoLocaleSetter.h

Issue 1526703003: Porting Skia for newlib compatibility. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAutoLocaleSetter.h
diff --git a/src/gpu/GrAutoLocaleSetter.h b/src/gpu/GrAutoLocaleSetter.h
index 08196debf61ba30d9109add414e68253a732995f..9f8ab2425ede44e7f92fbc7d98187840c8b229c6 100644
--- a/src/gpu/GrAutoLocaleSetter.h
+++ b/src/gpu/GrAutoLocaleSetter.h
@@ -22,6 +22,13 @@
#include <xlocale.h>
#endif
+#if defined(SK_BUILD_FOR_ANDROID) || defined(__UCLIBC__) || \
mtklein 2015/12/15 13:42:58 Skia typically wraps at column 100, so I bet this'
Sean Klein 2015/12/15 17:20:26 Done.
+ defined(_NEWLIB_VERSION)
+#define HAVE_LOCALE_T 0
mtklein 2015/12/15 13:42:58 We tend to indent inside #if blocks, but for somet
Sean Klein 2015/12/15 17:20:26 Acknowledged.
+#else
+#define HAVE_LOCALE_T 1
+#endif
+
/**
* Helper class for ensuring that we don't use the wrong locale when building shaders. Android
* doesn't support locale in the NDK, so this is a no-op there.
@@ -38,7 +45,7 @@ public:
} else {
fShouldRestoreLocale = false;
}
-#elif !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__)
+#elif HAVE_LOCALE_T
fLocale = newlocale(LC_ALL, name, 0);
if (fLocale) {
fOldLocale = uselocale(fLocale);
@@ -56,7 +63,7 @@ public:
setlocale(LC_ALL, fOldLocale.c_str());
}
_configthreadlocale(fOldPerThreadLocale);
-#elif !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__)
+#elif HAVE_LOCALE_T
if (fLocale) {
uselocale(fOldLocale);
freelocale(fLocale);
@@ -69,7 +76,7 @@ private:
int fOldPerThreadLocale;
bool fShouldRestoreLocale;
SkString fOldLocale;
-#elif !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__)
+#elif HAVE_LOCALE_T
locale_t fOldLocale;
locale_t fLocale;
#endif
mtklein 2015/12/15 13:42:58 Given that this is a header, let's #undef HAVE_LOC
Sean Klein 2015/12/15 17:20:26 Done.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698