Add a support for newlib

Newlib has _timezone instead of __timezone. pNaCl with newlib needs this change.

BUG=132145
TEST=When rolled, NaCl (with newlib) can be compiled without an error.
R=mark@chromium.org

Review URL: https://codereview.chromium.org/266503003

git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/icu52@267335 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
diff --git a/README.chromium b/README.chromium
index 0182247..77f98e4 100644
--- a/README.chromium
+++ b/README.chromium
@@ -26,9 +26,10 @@
 2. Apply the following patch for platform related headers (putilimpl.h and 
    others).
 
-  - patches/putil.patch for Android and QNX
+  - patches/putil.patch for Android, QNX and newlib(NaCl-newlib).
     Upstream bug for Android : http://bugs.icu-project.org/trac/ticket/10478
     Upstream bug for QNX : http://bugs.icu-project.org/trac/ticket/10811
+    Upstream bug for newlib : http://bugs.icu-project.org/trac/ticket/10873
 
 
 3. Breakiterator patches
diff --git a/patches/putil.patch b/patches/putil.patch
index 4ac0194..a6be1e1 100644
--- a/patches/putil.patch
+++ b/patches/putil.patch
@@ -11,3 +11,19 @@
  #   define U_HAVE_NL_LANGINFO_CODESET 0
  #else
  #   define U_HAVE_NL_LANGINFO_CODESET 1
+@@ -116,9 +116,12 @@
+ #elif U_PLATFORM == U_PF_ANDROID
+ #   define U_TIMEZONE timezone
+ #elif U_PLATFORM_IS_LINUX_BASED
+-#   if !defined(__UCLIBC__)
+-    /* __timezone is only available in glibc */
+-#       define U_TIMEZONE __timezone
++#   if defined(__UCLIBC__)
++    /* uClibc does not have __timezone or _timezone. */
++#   elif defined(_NEWLIB_VERSION)
++#      define U_TIMEZONE      _timezone
++#   elif defined(__GLIBC__)
++#      define U_TIMEZONE      __timezone
+ #   endif
+ #elif U_PLATFORM_USES_ONLY_WIN32_API
+ #   define U_TIMEZONE _timezone
diff --git a/source/common/putilimp.h b/source/common/putilimp.h
index 8980c75..11abe17 100644
--- a/source/common/putilimp.h
+++ b/source/common/putilimp.h
@@ -116,9 +116,12 @@
 #elif U_PLATFORM == U_PF_ANDROID
 #   define U_TIMEZONE timezone
 #elif U_PLATFORM_IS_LINUX_BASED
-#   if !defined(__UCLIBC__)
-    /* __timezone is only available in glibc */
-#       define U_TIMEZONE __timezone
+#   if defined(__UCLIBC__)
+    /* uClibc does not have __timezone or _timezone. */
+#   elif defined(_NEWLIB_VERSION)
+#      define U_TIMEZONE      _timezone
+#   elif defined(__GLIBC__)
+#      define U_TIMEZONE      __timezone
 #   endif
 #elif U_PLATFORM_USES_ONLY_WIN32_API
 #   define U_TIMEZONE _timezone