From d7d2dfe48dfc1339bd8671b47427f9f2e1a2f413 Mon Sep 17 00:00:00 2001 From: Michael Ow Date: Wed, 12 Aug 2009 18:57:25 +0000 Subject: [PATCH] ICU-7060 Include platform.h when building on Cygwin/MSVC. X-SVN-Rev: 26484 --- icu4c/source/common/unicode/platform.h.in | 9 ++++++--- icu4c/source/common/unicode/pwin32.h | 2 ++ icu4c/source/common/unicode/umachine.h | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/icu4c/source/common/unicode/platform.h.in b/icu4c/source/common/unicode/platform.h.in index de8b942b800..18221b65baa 100644 --- a/icu4c/source/common/unicode/platform.h.in +++ b/icu4c/source/common/unicode/platform.h.in @@ -29,6 +29,11 @@ #define @platform@ #endif +/* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */ +#define ICU_USE_THREADS @ICU_USE_THREADS@ + +/* Need platform.h when using CYGWINMSVC to get definition above. Ignore everything else. */ +#ifndef CYGWINMSVC /** * \def U_HAVE_DIRENT_H * Define whether dirent.h is available */ @@ -192,9 +197,6 @@ typedef unsigned int uint32_t; #define U_IS_BIG_ENDIAN @U_IS_BIG_ENDIAN@ #endif -/* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */ -#define ICU_USE_THREADS @ICU_USE_THREADS@ - /* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check lock. */ #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #define UMTX_STRONG_MEMORY_MODEL 1 @@ -381,5 +383,6 @@ typedef unsigned int uint32_t; #endif /** @} */ +#endif /* CYGWINMSVC */ #endif diff --git a/icu4c/source/common/unicode/pwin32.h b/icu4c/source/common/unicode/pwin32.h index a4e7c661c33..e72671b178f 100644 --- a/icu4c/source/common/unicode/pwin32.h +++ b/icu4c/source/common/unicode/pwin32.h @@ -181,7 +181,9 @@ typedef unsigned int uint32_t; #define U_IS_BIG_ENDIAN 0 /** 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */ +#ifndef ICU_USE_THREADS #define ICU_USE_THREADS 1 +#endif /* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check mutex lock. */ /** diff --git a/icu4c/source/common/unicode/umachine.h b/icu4c/source/common/unicode/umachine.h index 57ac9d9ad8e..f43df60e971 100644 --- a/icu4c/source/common/unicode/umachine.h +++ b/icu4c/source/common/unicode/umachine.h @@ -44,6 +44,9 @@ #if defined(U_PALMOS) # include "unicode/ppalmos.h" #elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) +#ifdef CYGWINMSVC +# include "unicode/platform.h" +#endif # include "unicode/pwin32.h" #else # include "unicode/platform.h"