From d565b3b2f35a6bb84377e1004d59d96902b91bcb Mon Sep 17 00:00:00 2001 From: Michael Ow Date: Thu, 3 Jun 2010 15:51:19 +0000 Subject: [PATCH] ICU-7581 Fix a few mingw build issues including symbolic links when building data and missing header file inclusion. X-SVN-Rev: 28125 --- icu4c/source/common/unicode/umachine.h | 2 +- icu4c/source/tools/pkgdata/pkgdata.cpp | 3 ++- icu4c/source/tools/toolutil/toolutil.cpp | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/icu4c/source/common/unicode/umachine.h b/icu4c/source/common/unicode/umachine.h index c6aed301820..abbdcb79f16 100644 --- a/icu4c/source/common/unicode/umachine.h +++ b/icu4c/source/common/unicode/umachine.h @@ -43,7 +43,7 @@ #if defined(U_PALMOS) # include "unicode/ppalmos.h" -#elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) +#elif !defined(__MINGW32__) && (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)) #ifdef CYGWINMSVC # include "unicode/platform.h" #endif diff --git a/icu4c/source/tools/pkgdata/pkgdata.cpp b/icu4c/source/tools/pkgdata/pkgdata.cpp index 08a517e7900..6064462ba67 100644 --- a/icu4c/source/tools/pkgdata/pkgdata.cpp +++ b/icu4c/source/tools/pkgdata/pkgdata.cpp @@ -851,7 +851,8 @@ static int32_t pkg_createSymLinks(const char *targetDir, UBool specialHandling) #ifndef USING_CYGWIN /* No symbolic link to make. */ - if (uprv_strlen(libFileNames[LIB_FILE_VERSION]) == 0 || uprv_strlen(libFileNames[LIB_FILE_VERSION_MAJOR]) == 0) { + if (uprv_strlen(libFileNames[LIB_FILE_VERSION]) == 0 || uprv_strlen(libFileNames[LIB_FILE_VERSION_MAJOR]) == 0 || + uprv_strcmp(libFileNames[LIB_FILE_VERSION], libFileNames[LIB_FILE_VERSION_MAJOR]) == 0) { return result; } diff --git a/icu4c/source/tools/toolutil/toolutil.cpp b/icu4c/source/tools/toolutil/toolutil.cpp index a866ece71be..27d010b3b5d 100644 --- a/icu4c/source/tools/toolutil/toolutil.cpp +++ b/icu4c/source/tools/toolutil/toolutil.cpp @@ -35,6 +35,12 @@ # include # include #endif + +/* In MinGW environment, io.h needs to be included for _mkdir() */ +#ifdef __MINGW32__ +#include +#endif + #include #include "unicode/errorcode.h" @@ -160,7 +166,7 @@ U_CAPI void U_EXPORT2 uprv_mkdir(const char *pathname, UErrorCode *status) { int retVal = 0; -#if defined(U_WINDOWS) +#if defined(U_WINDOWS) || defined(__MINGW32__) retVal = _mkdir(pathname); #else retVal = mkdir(pathname, S_IRWXU | (S_IROTH | S_IXOTH) | (S_IROTH | S_IXOTH));