#include <float.h>
/* include system headers */
-#if defined(U_WINDOWS) || defined(__MINGW32__)
+#if defined(U_WINDOWS) || defined(U_MINGW)
# define WIN32_LEAN_AND_MEAN
# define VC_EXTRALEAN
# define NOUSER
# endif
#endif
-#if defined(U_CYGWIN) && defined(__STRICT_ANSI__)
-/* tzset isn't defined in strict ANSI on Cygwin. */
+#if (defined(U_CYGWIN) || defined(U_MINGW)) && defined(__STRICT_ANSI__)
+/* tzset isn't defined in strict ANSI on Cygwin and MinGW. */
#undef __STRICT_ANSI__
#endif
functions).
---------------------------------------------------------------------------*/
-#if defined(U_WINDOWS) || defined(XP_MAC) || defined(OS400) || defined(__MINGW32__)
+#if defined(U_WINDOWS) || defined(XP_MAC) || defined(OS400) || defined(U_MINGW)
# undef U_POSIX_LOCALE
#else
# define U_POSIX_LOCALE 1
#endif
#ifdef U_TZNAME
-#if defined(U_WINDOWS) || defined(__MINGW32__)
+#if defined(U_WINDOWS) || defined(U_MINGW)
/* The return value is free'd in timezone.cpp on Windows because
* the other code path returns a pointer to a heap location. */
return uprv_strdup(U_TZNAME[n]);
return posixID;
-#elif defined(U_WINDOWS) || defined(__MINGW32__)
+#elif defined(U_WINDOWS) || defined(U_MINGW)
UErrorCode status = U_ZERO_ERROR;
LCID id = GetThreadLocale();
const char* locID = uprv_convertToPosix(id, &status);
/** Define whether inttypes.h is available */
#ifndef U_HAVE_INTTYPES_H
-# if defined(__BORLANDC__) || defined(__MINGW32__)
+# if defined(__BORLANDC__)
# define U_HAVE_INTTYPES_H 1
# else
# define U_HAVE_INTTYPES_H 0
*-*-aix*) platform=U_AIX ;;
*-*-hpux*) platform=U_HPUX ;;
*-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
- *-*-cygwin*|*-*-mingw*) platform=U_CYGWIN ;;
+ *-*-cygwin*) platform=U_CYGWIN ;;
+ *-*-mingw*) platform=U_MINGW ;;
*-*ibm-openedition*|*-*-os390*) platform=OS390
if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
ICUDATA_CHAR="e"
*-*-aix*) platform=U_AIX ;;
*-*-hpux*) platform=U_HPUX ;;
*-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
- *-*-cygwin*|*-*-mingw*) platform=U_CYGWIN ;;
+ *-*-cygwin*) platform=U_CYGWIN ;;
+ *-*-mingw*) platform=U_MINGW ;;
*-*ibm-openedition*|*-*-os390*) platform=OS390
if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
ICUDATA_CHAR="e"
/*****************************************************************************
*
-* Copyright (C) 1999-2010, International Business Machines
+* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************/
U_NAMESPACE_USE
-#if (defined(U_WINDOWS) || defined(U_CYGWIN)) && !defined(__STRICT_ANSI__)
+#if (defined(U_WINDOWS) || defined(U_CYGWIN) || defined(U_MINGW)) && !defined(__STRICT_ANSI__)
#include <io.h>
#include <fcntl.h>
#if defined(U_WINDOWS)
Linux/ICC Use the Intel ICC compiler on Linux
Linux/VA Use the IBM Visual Age compiler on Power PC Linux
MacOSX Use the GNU gcc/g++ compilers on MacOS X (Darwin)
+ MinGW Use the GNU gcc/g++ compilers on MinGW
QNX Use the QNX QCC compiler on QNX/Neutrino
Solaris Use the Sun cc/CC compilers on Solaris
Solaris/GCC Use the GNU gcc/g++ compilers on Solaris
DEBUG_CFLAGS='-g -O0'
DEBUG_CXXFLAGS='-g -O0'
;;
+ MinGW)
+ THE_OS="MinGW"
+ THE_COMP="the GNU C++"
+ RELEASE_CFLAGS='-O3'
+ RELEASE_CXXFLAGS='-O3'
+ ;;
*BSD)
THE_OS="BSD"
THE_COMP="the GNU C++"
/*
*******************************************************************************
*
-* Copyright (C) 1999-2010, International Business Machines
+* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
#include <stdio.h>
#include <ctype.h>
-#if defined(U_WINDOWS) || defined(U_CYGWIN)
+#if defined(U_WINDOWS) || defined(U_CYGWIN) || defined(U_MINGW)
#include <io.h>
#include <fcntl.h>
#define USE_FILENO_BINARY_MODE 1
if (tostdout) {
out = stdout;
-#if defined(U_WINDOWS) || defined(U_CYGWIN)
+#if defined(U_WINDOWS) || defined(U_CYGWIN) || defined(U_MINGW)
if (setmode(fileno(out), O_BINARY) == -1) {
fprintf(stderr, "%s: couldn't set standard output to binary mode\n", pname);
return 4;
#include "unicode/utypes.h"
#if U_HAVE_POPEN
-#if defined(U_CYGWIN) && defined(__STRICT_ANSI__)
-/* popen/pclose aren't defined in strict ANSI on Cygwin */
+#if (defined(U_CYGWIN) || defined(U_MINGW)) && defined(__STRICT_ANSI__)
+/* popen/pclose aren't defined in strict ANSI on Cygwin and MinGW */
#undef __STRICT_ANSI__
#endif
#endif
}
if (version != NULL) {
-#if defined(U_CYGWIN) && !defined(__MINGW32__)
+#if defined(U_CYGWIN)
sprintf(libFileNames[LIB_FILE_CYGWIN], "cyg%s.%s",
libName,
pkgDataFlags[SO_EXT]);
fprintf(stdout, "# libFileName[LIB_FILE_VERSION] = %s\n", libFileNames[LIB_FILE_VERSION]);
}
-#ifdef U_CYGWIN
- /* Cygwin only deals with the version major number. */
+#if defined(U_CYGWIN) || defined(U_MINGW)
+ /* Cygwin and MinGW only deals with the version major number. */
uprv_strcpy(libFileNames[LIB_FILE_VERSION_TMP], libFileNames[LIB_FILE_VERSION_MAJOR]);
#endif
}
char name1[SMALL_BUFFER_MAX_SIZE]; /* symlink file name */
char name2[SMALL_BUFFER_MAX_SIZE]; /* file name to symlink */
+#if defined (U_MINGW)
+ /* On MINGW, symbolic links don't need to be created. */
+ return result;
+#endif
+
#ifndef USING_CYGWIN
/* No symbolic link to make. */
if (uprv_strlen(libFileNames[LIB_FILE_VERSION]) == 0 || uprv_strlen(libFileNames[LIB_FILE_VERSION_MAJOR]) == 0 ||
fprintf(stderr, "Error installing library. Failed command: %s\n", cmd);
return result;
}
-#elif defined (U_CYGWIN)
+#elif defined(U_CYGWIN)
sprintf(cmd, "cd %s && %s %s %s",
targetDir,
pkgDataFlags[INSTALL_CMD],
}
#endif
-#if defined (__MINGW32__)
- /* On MINGW, symbolic links don't need to be created. */
- return result;
-#else
return pkg_createSymLinks(installDir, TRUE);
-#endif
}
static int32_t pkg_installCommonMode(const char *installDir, const char *fileName) {
}
freeCmd = TRUE;
}
-#if defined(U_CYGWIN) && !defined(__MINGW32__)
+#if defined(U_CYGWIN)
sprintf(cmd, "%s%s%s %s -o %s%s %s %s%s %s %s",
pkgDataFlags[GENLIB],
targetDir,
T_FileStream_close(f);
}
}
-#elif defined(U_CYGWIN) && !defined(__MINGW32__)
+#elif defined(U_CYGWIN)
/* Cygwin needs to change flag options. */
char *flag = NULL;
int32_t length = 0;
/*
*******************************************************************************
*
-* Copyright (C) 1999-2010, International Business Machines
+* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
#endif
/* In MinGW environment, io.h needs to be included for _mkdir() */
-#ifdef __MINGW32__
+#ifdef U_MINGW
#include <io.h>
#endif
uprv_mkdir(const char *pathname, UErrorCode *status) {
int retVal = 0;
-#if defined(U_WINDOWS) || defined(__MINGW32__)
+#if defined(U_WINDOWS) || defined(U_MINGW)
retVal = _mkdir(pathname);
#else
retVal = mkdir(pathname, S_IRWXU | (S_IROTH | S_IXOTH) | (S_IROTH | S_IXOTH));
#endif
if (retVal && errno != EEXIST) {
-#if defined(U_CYGWIN)
- /*if using Cygwin and the mkdir says it failed...check if the directory already exists..*/
- /* if it does...don't give the error, if it does not...give the error - Brian Rower - 6/25/08 */
- struct stat st;
-
- if(stat(pathname,&st) != 0)
- {
- *status = U_FILE_ACCESS_ERROR;
- }
+#if defined(U_CYGWIN) || defined(U_MINGW)
+ /*if using Cygwin and the mkdir says it failed...check if the directory already exists..*/
+ /* if it does...don't give the error, if it does not...give the error - Brian Rower - 6/25/08 */
+ struct stat st;
+
+ if(stat(pathname,&st) != 0)
+ {
+ *status = U_FILE_ACCESS_ERROR;
+ }
#else
*status = U_FILE_ACCESS_ERROR;
#endif