Fixes for ICU platform.h to compile with nacl/newlib.
diff --git a/genfiles/arch/linux/common/include/unicode/platform.h b/genfiles/arch/linux/common/include/unicode/platform.h
index db4d047..db4f0da 100644
--- a/genfiles/arch/linux/common/include/unicode/platform.h
+++ b/genfiles/arch/linux/common/include/unicode/platform.h
@@ -24,8 +24,8 @@
#define _PLATFORM_H
/**
- * \file
- * \brief Basic types for the platform
+ * \file
+ * \brief Basic types for the platform
*/
/* This file should be included before uvernum.h. */
@@ -34,7 +34,7 @@
#endif
/**
- * Determine wheter to enable auto cleanup of libraries.
+ * Determine wheter to enable auto cleanup of libraries.
* @internal
*/
#ifndef UCLN_NO_AUTO_CLEANUP
@@ -51,7 +51,7 @@
/**
* \def U_HAVE_DIRENT_H
- * Define whether dirent.h is available
+ * Define whether dirent.h is available
* @internal
*/
#ifndef U_HAVE_DIRENT_H
@@ -147,7 +147,7 @@
#endif
/* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
-#ifndef ICU_USE_THREADS
+#ifndef ICU_USE_THREADS
#define ICU_USE_THREADS 1
#endif
@@ -282,7 +282,13 @@
#if 1
#define U_TZSET tzset
#endif
-#if 1
+// NOTE(bmcquade): U_TIMEZONE is not present in newlib, which is the
+// supported toolchain for native client. Native client also supports
+// glibc however there seems to be no good way to differentiate
+// them. Thus we disable setting of U_TIMEZONE for all native client
+// builds. If we switch to nacl-glibc in the future, it would likely
+// make sense to revert this change.
+#ifndef __native_client__
#define U_TIMEZONE __timezone
#endif
#if 1
@@ -303,7 +309,7 @@
#elif 1
#define U_EXPORT __attribute__((visibility("default")))
#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
- || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
+ || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
#define U_EXPORT __global
/*#elif defined(__HP_aCC) || defined(__HP_cc)
#define U_EXPORT __declspec(dllexport)*/
@@ -318,7 +324,7 @@
#if defined(U_CYGWIN) && !defined(__GNUC__)
#define U_IMPORT __declspec(dllimport)
#else
-#define U_IMPORT
+#define U_IMPORT
#endif
/* @} */
@@ -336,7 +342,7 @@
#endif
#ifndef U_ALIGN_CODE
-#define U_ALIGN_CODE(n)
+#define U_ALIGN_CODE(n)
#endif
/** @} */
@@ -379,7 +385,7 @@
* Define the library suffix with C syntax.
* @internal
*/
-# define U_LIB_SUFFIX_C_NAME
+# define U_LIB_SUFFIX_C_NAME
/**
* Define the library suffix as a string with C syntax
* @internal
@@ -394,10 +400,14 @@
#if U_HAVE_LIB_SUFFIX
# ifndef U_ICU_ENTRY_POINT_RENAME
/* Renaming pattern: u_strcpy_41_suffix */
-# define U_ICU_ENTRY_POINT_RENAME(x) x ## _ ## 46 ##
+# define U_ICU_ENTRY_POINT_RENAME(x) x ## _ ## 46 ##
# define U_DEF_ICUDATA_ENTRY_POINT(major, minor) icudt####major##minor##_dat
# endif
#endif
+// NOTE(bmcquade): We disable all file IO here. We should not need it,
+// and readlink, etc do not work in NaCL.
+#define UCONFIG_NO_FILE_IO 1
+
#endif