<ul >
<li><a href="#RecBuild">Recommended Build Options</a></li>
+ <li><a href="#UserConfig">User-Configurable Settings</a></li>
+
<li><a href="#HowToBuildWindows">Windows</a></li>
<li><a href="#HowToBuildCygwin">Cygwin</a></li>
As a result, for example, rather than <code>U_NAMESPACE_QUALIFIER UnicodeString</code>
you can now simply write <code>icu::UnicodeString</code>.</p>
+ <h3>One shared platform.h</h3>
+ <p>ICU4C 49 does not generate any source code files via autoconf any more.
+ Instead, platform.h itself is now a normal source header file,
+ and determines platform-specific settings via <code>#if ...</code> etc.</p>
+
+ <p>As a result, it is easier to cross-compile ICU4C and/or use different build systems.
+ No more headers are <code>#include</code>d from the build-output directory,
+ and all platforms use the same set of source code files.</p>
+
+ <p>However, it is likely that ICU4C 49 will not compile on some platforms
+ (non-POSIX and/or older/unusual compilers etc.) that the ICU team did not test.
+ As a temporary workaround, any platform-dependent macro for which <code>platform.h</code>
+ does not determine the correct value can be predefined via <code>CPPFLAGS</code>
+ or by adding an explicit <code>#define ...</code> into <code>platform.h</code>
+ before it first tests that macro.</p>
+
+ <p>Please submit a bug ticket per platform with details about your compiler,
+ its version and its predefined macros.
+ (For example, preprocessing an empty source file with gcc's <code>-dM</code> option
+ outputs all of gcc's predefined macros: <code>gcc -E -dM -x c /dev/null | sort</code>)
+ A patch to fix the problem would be welcome too!</p>
+
<h2><a name="Download" href="#Download" id="Download">How To Download the
Source Code</a></h2>
for applications to include and get the correct entry point names.</li>
</ul>
+ <h3><a name="UserConfig" href="#UserConfig" id="UserConfig">User-Configurable Settings</a></h3>
+ <p>ICU4C can be customized via a number of user-configurable settings.
+ Many of them are controlled by preprocessor macros which are
+ defined in the <code>source/common/unicode/uconfig.h</code> header file.
+ Some turn off parts of ICU, for example conversion or collation,
+ trading off a smaller library for reduced functionality.
+ Other settings are recommended (see previous section)
+ but their default values are set for better source code compatibility.</p>
+
+ <p>In order to change such user-configurable settings, you can
+ either modify the <code>uconfig.h</code> header file by adding
+ a specific <code>#define ...</code> for one or more of the macros
+ before they are first tested,
+ or set the compiler's preprocessor flags (<code>CPPFLAGS</code>) to include
+ an equivalent <code>-D</code> macro definition.</p>
+
<h3><a name="HowToBuildWindows" href="#HowToBuildWindows" id=
"HowToBuildWindows">How To Build And Install On Windows</a></h3>
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(srcdir) $(LIBCPPFLAGS) $(CPPFLAGSICUUC)
-# we want DEFS here, because we want icucfg.h
-DEFS += -DU_COMMON_IMPLEMENTATION -DU_HAVE_ICUCFG
+# we want DEFS here
+DEFS += -DU_COMMON_IMPLEMENTATION
LDFLAGS += $(LDFLAGSICUUC)
# for plugin configuration
dist: dist-local
check: all check-local
-all-local: $(ALL_TARGETS) unicode/platform.h
+all-local: $(ALL_TARGETS)
install-local: install-headers install-library
$(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS) $(SO_VERSION_DATA)
distclean-local: clean-local
- $(RMV) Makefile icucfg.h unicode/platform.h $(SVC_HOOK_INC)
+ $(RMV) Makefile icucfg.h $(SVC_HOOK_INC)
check-local:
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-unicode/platform.h: $(srcdir)/unicode/platform.h.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
ifneq ($(ENABLE_STATIC),)
$(TARGET): $(STATIC_OBJECTS)
$(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $^
/*
**********************************************************************
-* Copyright (c) 2001-2010, International Business Machines
+* Copyright (c) 2001-2011, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
// Windows needs us to DLL-export the MaybeStackArray template specialization,
// but MacOS X cannot handle it. Same as in digitlst.h.
-#if !defined(U_DARWIN)
+#if !U_PLATFORM_IS_DARWIN_BASED
template class U_COMMON_API MaybeStackArray<char, 40>;
#endif
U_CAPI void U_EXPORT2
uprv_deleteUObject(void *obj);
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
U_NAMESPACE_BEGIN
U_NAMESPACE_END
-#endif /* XP_CPLUSPLUS */
+#endif /* __cplusplus */
#endif /* CMEMORY_H */
</CustomBuild>\r
<ClInclude Include="locmap.h" />\r
<ClInclude Include="mutex.h" />\r
- <CustomBuild Include="unicode\putil.h">\r
+ <CustomBuild Include="unicode\platform.h">\r
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode\r
</Command>\r
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
</Command>\r
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
</CustomBuild>\r
- <ClInclude Include="putilimp.h" />\r
- <CustomBuild Include="unicode\pwin32.h">\r
+ <CustomBuild Include="unicode\ptypes.h">\r
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode\r
+</Command>\r
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">copy "%(FullPath)" ..\..\include\unicode\r
+</Command>\r
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy "%(FullPath)" ..\..\include\unicode\r
+</Command>\r
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">copy "%(FullPath)" ..\..\include\unicode\r
+</Command>\r
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
+ </CustomBuild>\r
+ <CustomBuild Include="unicode\putil.h">\r
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode\r
</Command>\r
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
</Command>\r
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
</CustomBuild>\r
+ <ClInclude Include="putilimp.h" />\r
<CustomBuild Include="unicode\std_string.h">\r
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode\r
</Command>\r
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
</ProjectReference>\r
</ItemGroup>\r
- <ItemGroup>\r
- <CustomBuild Include="unicode\platform.win">\r
- <FileType>Document</FileType>\r
- <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" unicode\%(FileName).h\r
-copy "%(FullPath)" ..\..\include\unicode\%(FileName).h</Command>\r
- <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">unicode\%(Filename).h;..\..\include\unicode\%(Filename).h;%(Outputs)</Outputs>\r
- <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">copy "%(FullPath)" unicode\%(FileName).h\r
-copy "%(FullPath)" ..\..\include\unicode\%(FileName).h</Command>\r
- <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">unicode\%(Filename).h;..\..\include\unicode\%(Filename).h;%(Outputs)</Outputs>\r
- <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy "%(FullPath)" unicode\%(FileName).h\r
-copy "%(FullPath)" ..\..\include\unicode\%(FileName).h</Command>\r
- <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">unicode\%(Filename).h;..\..\include\unicode\%(Filename).h;%(Outputs)</Outputs>\r
- <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">copy "%(FullPath)" unicode\%(FileName).h\r
-copy "%(FullPath)" ..\..\include\unicode\%(FileName).h</Command>\r
- <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">unicode\%(Filename).h;..\..\include\unicode\%(Filename).h;%(Outputs)</Outputs>\r
- </CustomBuild>\r
- </ItemGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<ImportGroup Label="ExtensionTargets">\r
</ImportGroup>\r
<CustomBuild Include="unicode\icudataver.h">\r
<Filter>configuration</Filter>\r
</CustomBuild>\r
- <CustomBuild Include="unicode\platform.win">\r
+ <CustomBuild Include="unicode\platform.h">\r
<Filter>configuration</Filter>\r
</CustomBuild>\r
- <CustomBuild Include="unicode\putil.h">\r
+ <CustomBuild Include="unicode\ptypes.h">\r
<Filter>configuration</Filter>\r
</CustomBuild>\r
- <CustomBuild Include="unicode\pwin32.h">\r
+ <CustomBuild Include="unicode\putil.h">\r
<Filter>configuration</Filter>\r
</CustomBuild>\r
<CustomBuild Include="unicode\std_string.h">\r
/*
******************************************************************************
*
-* Copyright (C) 1997-2005, International Business Machines
+* Copyright (C) 1997-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
#define uprv_strtod(source, end) U_STANDARD_CPP_NAMESPACE strtod(source, end)
#define uprv_strtoul(str, end, base) U_STANDARD_CPP_NAMESPACE strtoul(str, end, base)
#define uprv_strtol(str, end, base) U_STANDARD_CPP_NAMESPACE strtol(str, end, base)
-#ifdef U_WINDOWS
+#if U_PLATFORM_USES_ONLY_WIN32_API
# if defined(__BORLANDC__)
# define uprv_stricmp(str1, str2) U_STANDARD_CPP_NAMESPACE stricmp(str1, str2)
# define uprv_strnicmp(str1, str2, n) U_STANDARD_CPP_NAMESPACE strnicmp(str1, str2, n)
#include "cstring.h"
#include "cmemory.h"
-#if defined(U_WINDOWS) && defined(_MSC_VER) && (_MSC_VER >= 1500)
+#if U_PLATFORM == U_PF_WINDOWS && defined(_MSC_VER) && (_MSC_VER >= 1500)
+/*
+ * TODO: It seems like we should widen this to
+ * either U_PLATFORM_USES_ONLY_WIN32_API (includes MinGW)
+ * or U_PLATFORM_HAS_WIN32_API (includes MinGW and Cygwin)
+ * but those use gcc and won't have defined(_MSC_VER).
+ * We might need to #include some Windows header and test for some version macro from there.
+ * Or call some Windows function and see what it returns.
+ */
#define USE_WINDOWS_LOCALE_API
#endif
#include <float.h>
/* include system headers */
-#if defined(U_WINDOWS) || defined(U_MINGW)
+#if U_PLATFORM_USES_ONLY_WIN32_API
+ /*
+ * TODO: U_PLATFORM_USES_ONLY_WIN32_API includes MinGW.
+ * Should Cygwin be included as well (U_PLATFORM_HAS_WIN32_API)
+ * to use native APIs as much as possible?
+ */
# define WIN32_LEAN_AND_MEAN
# define VC_EXTRALEAN
# define NOUSER
# define NOMCX
# include <windows.h>
# include "wintz.h"
-#elif defined(OS400)
+#elif U_PLATFORM == U_PF_OS400
# include <float.h>
# include <qusec.h> /* error code structure */
# include <qusrjobi.h>
# include <qliept.h> /* EPT_CALL macro - this include must be after all other "QSYSINCs" */
# include <mih/testptr.h> /* For uprv_maximumPtr */
-#elif defined(XP_MAC)
+#elif U_PLATFORM == U_PF_CLASSIC_MACOS
# include <Files.h>
# include <IntlResources.h>
# include <Script.h>
# include <MacTypes.h>
# include <TextUtils.h>
# define ICU_NO_USER_DATA_OVERRIDE 1
-#elif defined(OS390)
+#elif U_PLATFORM == U_PF_OS390
# include "unicode/ucnv.h" /* Needed for UCNV_SWAP_LFNL_OPTION_STRING */
-#elif defined(U_DARWIN) || defined(U_LINUX) || defined(U_BSD)
+#elif U_PLATFORM_IS_DARWIN_BASED || U_PLATFORM_IS_LINUX_BASED || U_PLATFORM == U_PF_BSD
# include <limits.h>
# include <unistd.h>
-#elif defined(U_QNX)
+#elif U_PLATFORM == U_PF_QNX
# include <sys/neutrino.h>
-#elif defined(U_SOLARIS)
+#elif U_PLATFORM == U_PF_SOLARIS
# ifndef _XPG4_2
# define _XPG4_2
# endif
#endif
-#if (defined(U_CYGWIN) || defined(U_MINGW)) && defined(__STRICT_ANSI__)
+#if (U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(__STRICT_ANSI__)
/* tzset isn't defined in strict ANSI on Cygwin and MinGW. */
#undef __STRICT_ANSI__
#endif
*/
#include <time.h>
-#if defined(U_DARWIN)
-#include <TargetConditionals.h>
-#endif
-
-#ifndef U_WINDOWS
+#if !U_PLATFORM_USES_ONLY_WIN32_API
#include <sys/time.h>
#endif
* icucfg.h via autoheader.
*/
#if defined(U_HAVE_ICUCFG)
-#include "icucfg.h"
+# include "icucfg.h"
+#elif U_PLATFORM_IMPLEMENTS_POSIX
+# define HAVE_DLFCN_H 1
+# define HAVE_DLOPEN 1
+# define HAVE_GETTIMEOFDAY 1
+#else
+# undef HAVE_DLFCN_H
+# undef HAVE_DLOPEN
+# undef HAVE_GETTIMEOFDAY
#endif
#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
functions).
---------------------------------------------------------------------------*/
-#if defined(U_WINDOWS) || defined(XP_MAC) || defined(OS400) || defined(U_MINGW)
+#if U_PLATFORM_USES_ONLY_WIN32_API || U_PLATFORM == U_PF_CLASSIC_MACOS || U_PLATFORM == U_PF_OS400
# undef U_POSIX_LOCALE
#else
# define U_POSIX_LOCALE 1
}
#endif
-#if defined(U_WINDOWS)
+#if U_PLATFORM_USES_ONLY_WIN32_API
typedef union {
int64_t int64;
FILETIME fileTime;
U_CAPI UDate U_EXPORT2
uprv_getRawUTCtime()
{
-#if defined(XP_MAC)
+#if U_PLATFORM == U_PF_CLASSIC_MACOS
time_t t, t1, t2;
struct tm tmrec;
uprv_memcpy( &tmrec, gmtime(&t), sizeof(tmrec) );
t2 = mktime(&tmrec); /* seconds of current GMT*/
return (UDate)(t2 - t1) * U_MILLIS_PER_SECOND; /* GMT (or UTC) in seconds since 1970*/
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_USES_ONLY_WIN32_API
FileTimeConversion winTime;
GetSystemTimeAsFileTime(&winTime.fileTime);
/* Infinity is 0x7FF0000000000000U. Anything greater than that is a NaN */
return (UBool)((convertedNumber.i64 & U_INT64_MAX) > gInf.i64);
-#elif defined(OS390)
+#elif U_PLATFORM == U_PF_OS390
uint32_t highBits = *(uint32_t*)u_topNBytesOfDouble(&number,
sizeof(uint32_t));
uint32_t lowBits = *(uint32_t*)u_bottomNBytesOfDouble(&number,
convertedNumber.d64 = number;
/* Infinity is exactly 0x7FF0000000000000U. */
return (UBool)((convertedNumber.i64 & U_INT64_MAX) == gInf.i64);
-#elif defined(OS390)
+#elif U_PLATFORM == U_PF_OS390
uint32_t highBits = *(uint32_t*)u_topNBytesOfDouble(&number,
sizeof(uint32_t));
uint32_t lowBits = *(uint32_t*)u_bottomNBytesOfDouble(&number,
U_CAPI UBool U_EXPORT2
uprv_isPositiveInfinity(double number)
{
-#if IEEE_754 || defined(OS390)
+#if IEEE_754 || U_PLATFORM == U_PF_OS390
return (UBool)(number > 0 && uprv_isInfinite(number));
#else
return uprv_isInfinite(number);
U_CAPI UBool U_EXPORT2
uprv_isNegativeInfinity(double number)
{
-#if IEEE_754 || defined(OS390)
+#if IEEE_754 || U_PLATFORM == U_PF_OS390
return (UBool)(number < 0 && uprv_isInfinite(number));
#else
U_CAPI double U_EXPORT2
uprv_getNaN()
{
-#if IEEE_754 || defined(OS390)
+#if IEEE_754 || U_PLATFORM == U_PF_OS390
return gNan.d64;
#else
/* If your platform doesn't support IEEE 754 but *does* have an NaN value,*/
U_CAPI double U_EXPORT2
uprv_getInfinity()
{
-#if IEEE_754 || defined(OS390)
+#if IEEE_754 || U_PLATFORM == U_PF_OS390
return gInf.d64;
#else
/* If your platform doesn't support IEEE 754 but *does* have an infinity*/
U_CAPI void * U_EXPORT2
uprv_maximumPtr(void * base)
{
-#if defined(OS400)
+#if U_PLATFORM == U_PF_OS400
/*
* With the provided function we should never be out of range of a given segment
* (a traditional/typical segment that is). Our segments have 5 bytes for the
/* Note that U_TZNAME does *not* have to be tzname, but if it is,
some platforms need to have it declared here. */
-#if defined(U_TZNAME) && (defined(U_IRIX) || defined(U_DARWIN) || defined(U_CYGWIN))
+#if defined(U_TZNAME) && (U_PLATFORM == U_PF_IRIX || U_PLATFORM_IS_DARWIN_BASED || U_PLATFORM == U_PF_CYGWIN)
/* RS6000 and others reject char **tzname. */
extern U_IMPORT char *U_TZNAME[];
#endif
-#if !UCONFIG_NO_FILE_IO && (defined(U_DARWIN) || defined(U_LINUX) || defined(U_BSD))
+#if !UCONFIG_NO_FILE_IO && (U_PLATFORM_IS_DARWIN_BASED || U_PLATFORM_IS_LINUX_BASED || U_PLATFORM == U_PF_BSD)
/* These platforms are likely to use Olson timezone IDs. */
#define CHECK_LOCALTIME_LINK 1
-#if defined(U_DARWIN)
+#if U_PLATFORM_IS_DARWIN_BASED
#include <tzfile.h>
#define TZZONEINFO (TZDIR "/")
#else
static char *gTimeZoneBufferPtr = NULL;
#endif
-#ifndef U_WINDOWS
+#if !U_PLATFORM_USES_ONLY_WIN32_API
#define isNonDigit(ch) (ch < '0' || '9' < ch)
static UBool isValidOlsonID(const char *id) {
int32_t idx = 0;
}
#endif
-#if defined(U_TZNAME) && !defined(U_WINDOWS)
+#if defined(U_TZNAME) && !U_PLATFORM_USES_ONLY_WIN32_API
#define CONVERT_HOURS_TO_SECONDS(offset) (int32_t)(offset*3600)
typedef struct OffsetZoneMapping {
uprv_tzname(int n)
{
const char *tzid = NULL;
-#ifdef U_WINDOWS
+#if U_PLATFORM_USES_ONLY_WIN32_API
tzid = uprv_detectWindowsTimeZone();
if (tzid != NULL) {
}
#else
-/*#if defined(U_DARWIN)
+/*#if U_PLATFORM_IS_DARWIN_BASED
int ret;
tzid = getenv("TZFILE");
#endif
#ifdef U_TZNAME
-#if defined(U_WINDOWS) || defined(U_MINGW)
+#if U_PLATFORM_USES_ONLY_WIN32_API
/* 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]);
}
#endif
-#if defined(U_WINDOWS)
+#if U_PLATFORM_USES_ONLY_WIN32_API
if( (((path[0] >= 'A') && (path[0] <= 'Z')) ||
((path[0] >= 'a') && (path[0] <= 'z'))) &&
path[1] == ':' ) {
/* Temporary backup setting of ICU_DATA_DIR_PREFIX_ENV_VAR
until some client wrapper makefiles are updated */
-#if defined(U_DARWIN) && TARGET_IPHONE_SIMULATOR
+#if U_PLATFORM_IS_DARWIN_BASED && TARGET_IPHONE_SIMULATOR
# if !defined(ICU_DATA_DIR_PREFIX_ENV_VAR)
# define ICU_DATA_DIR_PREFIX_ENV_VAR "IPHONE_SIMULATOR_ROOT"
# endif
/* Macintosh-specific locale information ------------------------------------ */
-#ifdef XP_MAC
+#if U_PLATFORM == U_PF_CLASSIC_MACOS
typedef struct {
int32_t script;
return posixID;
-#elif defined(U_WINDOWS) || defined(U_MINGW)
+#elif U_PLATFORM_USES_ONLY_WIN32_API
UErrorCode status = U_ZERO_ERROR;
LCID id = GetThreadLocale();
const char* locID = uprv_convertToPosix(id, &status);
}
return locID;
-#elif defined(XP_MAC)
+#elif U_PLATFORM == U_PF_CLASSIC_MACOS
int32_t script = MAC_LC_INIT_NUMBER;
/* = IntlScript(); or GetScriptManagerVariable(smSysScript);*/
int32_t region = MAC_LC_INIT_NUMBER;
return posixID;
-#elif defined(OS400)
+#elif U_PLATFORM == U_PF_OS400
/* locales are process scoped and are by definition thread safe */
static char correctedLocale[64];
const char *localeID = getenv("LC_ALL");
if (name == NULL) {
return NULL;
}
-#if defined(U_AIX)
+#if U_PLATFORM == U_PF_AIX
if (uprv_strcmp(name, "IBM-943") == 0) {
/* Use the ASCII compatible ibm-943 */
name = "Shift-JIS";
/* Use the windows-1252 that contains the Euro */
name = "IBM-5348";
}
-#elif defined(U_SOLARIS)
+#elif U_PLATFORM == U_PF_SOLARIS
if (locale != NULL && uprv_strcmp(name, "EUC") == 0) {
/* Solaris underspecifies the "EUC" name. */
if (uprv_strcmp(locale, "zh_CN") == 0) {
*/
name = "ISO-8859-1";
}
-#elif defined(U_DARWIN)
+#elif U_PLATFORM_IS_DARWIN_BASED
if (locale == NULL && *name == 0) {
/*
No locale was specified, and an empty name was passed in.
*/
name = "UTF-8";
}
-#elif defined(U_BSD)
+#elif U_PLATFORM == U_PF_BSD
if (uprv_strcmp(name, "CP949") == 0) {
/* Remap CP949 to a similar codepage to avoid issues with backslash and won symbol. */
name = "EUC-KR";
}
-#elif defined(U_HPUX)
+#elif U_PLATFORM == U_PF_HPUX
if (locale != NULL && uprv_strcmp(locale, "zh_HK") == 0 && uprv_strcmp(name, "big5") == 0) {
/* HP decided to extend big5 as hkbig5 even though it's not compatible :-( */
/* zh_TW.big5 is not the same charset as zh_HK.big5! */
*/
name = "eucjis";
}
-#elif defined(U_LINUX)
+#elif U_PLATFORM == U_PF_LINUX
if (locale != NULL && uprv_strcmp(name, "euc") == 0) {
/* Linux underspecifies the "EUC" name. */
if (uprv_strcmp(locale, "korean") == 0) {
static const char*
int_getDefaultCodepage()
{
-#if defined(OS400)
+#if U_PLATFORM == U_PF_OS400
uint32_t ccsid = 37; /* Default to ibm-37 */
static char codepage[64];
Qwc_JOBI0400_t jobinfo;
sprintf(codepage,"ibm-%d", ccsid);
return codepage;
-#elif defined(OS390)
+#elif U_PLATFORM == U_PF_OS390
static char codepage[64];
strncpy(codepage, nl_langinfo(CODESET),63-strlen(UCNV_SWAP_LFNL_OPTION_STRING));
return codepage;
-#elif defined(XP_MAC)
+#elif U_PLATFORM == U_PF_CLASSIC_MACOS
return "macintosh"; /* TODO: Macintosh Roman. There must be a better way. fixme! */
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_USES_ONLY_WIN32_API
static char codepage[64];
sprintf(codepage, "windows-%d", GetACP());
return codepage;
nl_langinfo may use the same buffer as setlocale. */
{
const char *codeset = nl_langinfo(U_NL_LANGINFO_CODESET);
-#if defined(U_DARWIN) || defined(U_LINUX)
+#if U_PLATFORM_IS_DARWIN_BASED || U_PLATFORM_IS_LINUX_BASED
/*
* On Linux and MacOSX, ensure that default codepage for non C/POSIX locale is UTF-8
* instead of ASCII.
#if defined(U_CHECK_DYLOAD)
-#if defined(HAVE_DLOPEN)
+#if defined(HAVE_DLOPEN) && !U_PLATFORM_HAS_WIN32_API
#ifdef HAVE_DLFCN_H
+
#ifdef __MVS__
#ifndef __SUSV3
#define __SUSV3 1
#endif
-#elif defined U_WINDOWS
+#elif U_PLATFORM_HAS_WIN32_API
U_INTERNAL void * U_EXPORT2
uprv_dl_open(const char *libName, UErrorCode *status) {
* @internal
*/
#ifndef U_MAX_PTR
-# if defined(OS390) && !defined(_LP64)
+# if U_PLATFORM == U_PF_OS390 && !defined(_LP64)
/* We have 31-bit pointers. */
# define U_MAX_PTR(base) ((void *)0x7fffffff)
-# elif defined(OS400)
+# elif U_PLATFORM == U_PF_OS400
# define U_MAX_PTR(base) uprv_maximumPtr((void *)base)
# elif 0
/*
/*
*******************************************************************************
*
-* Copyright (C) 1999-2005,2008 International Business Machines
+* Copyright (C) 1999-2011 International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
const void *inData, int32_t length, void *outData,
UErrorCode *pErrorCode);
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
#include "unicode/uobject.h"
#include "unicode/unistr.h"
* 3) Implementing own automatic cleanup functions
*
* For option 1, ensure that UCLN_NO_AUTO_CLEANUP is set to 0 by using --enable-auto-cleanup
- * configure option or by setting UCLN_NO_AUTO_CLEANUP to 0 in pwin32.h (For Visual Studio
- * solution file builds)
+ * configure option or by otherwise setting UCLN_NO_AUTO_CLEANUP to 0
* For option 2, follow option 1 and also define UCLN_AUTO_ATEXIT
* For option 3, follow option 1 and also define UCLN_AUTO_LOCAL (see below for more information)
*/
/* This function must be defined, if UCLN_FINI is defined, else link error. */
UCLN_CLEAN_ME_UP;
}
-#elif defined(__GNUC__)
-/* GCC - use __attribute((destructor)) */
-static void ucln_destructor() __attribute__((destructor)) ;
-
-static void ucln_destructor()
-{
- UCLN_CLEAN_ME_UP;
-}
/* Windows: DllMain */
-#elif defined (U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
/*
* ICU's own DllMain.
*/
}
return status;
}
+
+#elif defined(__GNUC__)
+/* GCC - use __attribute((destructor)) */
+static void ucln_destructor() __attribute__((destructor)) ;
+
+static void ucln_destructor()
+{
+ UCLN_CLEAN_ME_UP;
+}
+
#endif
#endif /* UCLN_NO_AUTO_CLEANUP */
#if (U_CHARSET_FAMILY == U_ASCII_FAMILY)
name = "US-ASCII";
/* there is no 'algorithmic' converter for EBCDIC */
-#elif defined(OS390)
+#elif U_PLATFORM == U_PF_OS390
name = "ibm-1047_P100-1995" UCNV_SWAP_LFNL_OPTION_STRING;
#else
name = "ibm-37_P100-1995";
* created by: Markus W. Scherer
*/
-#include "unicode/utypes.h" /* U_LINUX */
+#include "unicode/utypes.h" /* U_PLATFORM etc. */
-#ifdef U_LINUX
+#ifdef __GNUC__
/* if gcc
#define ATTRIBUTE_WEAK __attribute__ ((weak))
might have to #include some other header
/*
******************************************************************************
*
-* Copyright (C) 1999-2010, International Business Machines
+* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************/
if(pdh==NULL || (pdh->dataHeader.magic1==0xda && pdh->dataHeader.magic2==0x27)) {
return pdh;
} else {
-#ifdef OS400
+#if U_PLATFORM == U_PF_OS400
/*
TODO: Fix this once the compiler implements this feature. Keep in sync with genccode.c
/*
******************************************************************************
*
-* Copyright (C) 1999-2010, International Business Machines
+* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************/
# define LIB_SUFFIX ".dll"
/* This is inconvienient until we figure out what to do with U_ICUDATA_NAME in utypes.h */
# define U_ICUDATA_ENTRY_NAME "icudt" U_ICU_VERSION_SHORT U_LIB_SUFFIX_C_NAME_STRING "_dat"
-# else
-# if defined(U_DARWIN)
-# include <TargetConditionals.h>
-# endif
# endif
#elif MAP_IMPLEMENTATION==MAP_STDIO
# include <stdio.h>
}
/* get a view of the mapping */
-#ifndef U_HPUX
+#if U_PLATFORM != U_PF_HPUX
data=mmap(0, length, PROT_READ, MAP_SHARED, fd, 0);
#else
data=mmap(0, length, PROT_READ, MAP_PRIVATE, fd, 0);
pData->map = (char *)data + length;
pData->pHeader=(const DataHeader *)data;
pData->mapAddr = data;
-#if defined(U_DARWIN) && TARGET_OS_IPHONE
+#if U_PLATFORM == U_PF_IPHONE
posix_madvise(data, length, POSIX_MADV_RANDOM);
#endif
return TRUE;
/*
******************************************************************************
*
-* Copyright (C) 1999-2010, International Business Machines
+* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************/
#if UCONFIG_NO_FILE_IO
# define MAP_IMPLEMENTATION MAP_NONE
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
# define MAP_IMPLEMENTATION MAP_WIN32
-#elif U_HAVE_MMAP || defined(OS390)
-# if defined(OS390) && defined (OS390_STUBDATA)
+#elif U_HAVE_MMAP || U_PLATFORM == U_PF_OS390
+# if U_PLATFORM == U_PF_OS390 && defined (OS390_STUBDATA)
/* No memory mapping for 390 batch mode. Fake it using dll loading. */
# define MAP_IMPLEMENTATION MAP_390DLL
# else
* platform independent set of mutex operations. For internal ICU use only.
*/
-/* Assume POSIX, and modify as necessary below */
-#define POSIX
-
-#if defined(U_WINDOWS)
-#undef POSIX
-#endif
-#if defined(macintosh)
-#undef POSIX
-#endif
-#if defined(OS2)
-#undef POSIX
+#if U_PLATFORM_HAS_WIN32_API
+ /* Prefer native Windows APIs even if POSIX is implemented (i.e., on Cygwin). */
+# undef POSIX
+#elif U_PLATFORM_IMPLEMENTS_POSIX
+# define POSIX
+#else
+# undef POSIX
#endif
#if defined(POSIX) && (ICU_USE_THREADS==1)
#endif /* POSIX && (ICU_USE_THREADS==1) */
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
# define WIN32_LEAN_AND_MEAN
# define VC_EXTRALEAN
# define NOUSER
mutexed_compare_and_swap(dest, newval, oldval)
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
#define MUTEX_TYPE CRITICAL_SECTION
#define PLATFORM_MUTEX_INIT(m) InitializeCriticalSection(m)
#define PLATFORM_MUTEX_LOCK(m) EnterCriticalSection(m)
if (pIncFn) {
retVal = (*pIncFn)(gIncDecContext, p);
} else {
- #if defined (U_WINDOWS) && ICU_USE_THREADS == 1
+ #if !ICU_USE_THREADS
+ /* ICU thread support compiled out. */
+ retVal = ++(*p);
+ #elif U_PLATFORM_HAS_WIN32_API
retVal = InterlockedIncrement((LONG*)p);
#elif defined(USE_MAC_OS_ATOMIC_INCREMENT)
retVal = OSAtomicIncrement32Barrier(p);
#elif (U_HAVE_GCC_ATOMICS == 1)
retVal = __sync_add_and_fetch(p, 1);
- #elif defined (POSIX) && ICU_USE_THREADS == 1
+ #elif defined (POSIX)
umtx_lock(&gIncDecMutex);
retVal = ++(*p);
umtx_unlock(&gIncDecMutex);
#else
- /* Unknown Platform, or ICU thread support compiled out. */
+ /* Unknown Platform. */
retVal = ++(*p);
#endif
}
if (pDecFn) {
retVal = (*pDecFn)(gIncDecContext, p);
} else {
- #if defined (U_WINDOWS) && ICU_USE_THREADS == 1
+ #if !ICU_USE_THREADS
+ /* ICU thread support compiled out. */
+ retVal = --(*p);
+ #elif U_PLATFORM_HAS_WIN32_API
retVal = InterlockedDecrement((LONG*)p);
#elif defined(USE_MAC_OS_ATOMIC_INCREMENT)
retVal = OSAtomicDecrement32Barrier(p);
#elif (U_HAVE_GCC_ATOMICS == 1)
retVal = __sync_sub_and_fetch(p, 1);
- #elif defined (POSIX) && ICU_USE_THREADS == 1
+ #elif defined (POSIX)
umtx_lock(&gIncDecMutex);
retVal = --(*p);
umtx_unlock(&gIncDecMutex);
#else
- /* Unknown Platform, or ICU thread support compiled out. */
+ /* Unknown Platform. */
retVal = --(*p);
#endif
}
#include "unicode/utypes.h"
#include "unicode/uclean.h"
-#if defined(U_WINDOWS)
+#if defined(_MSC_VER) && _MSC_VER >= 1500
# include <intrin.h>
#endif
-#if defined(U_DARWIN)
+#if U_PLATFORM_IS_DARWIN_BASED
#if defined(__STRICT_ANSI__)
#define UPRV_REMAP_INLINE
#define inline
# define ANNOTATE_UNPROTECTED_READ(x) (x)
#endif
-/* APP_NO_THREADS is an old symbol. We'll honour it if present. */
-#ifdef APP_NO_THREADS
-# define ICU_USE_THREADS 0
-#endif
-
-/* ICU_USE_THREADS
- *
- * Allows thread support (use of mutexes) to be compiled out of ICU.
- * Default: use threads.
- * Even with thread support compiled out, applications may override the
- * (empty) mutex implementation with the u_setMutexFunctions() functions.
- */
-#ifndef ICU_USE_THREADS
-# define ICU_USE_THREADS 1
-#endif
-
#ifndef UMTX_FULL_BARRIER
# if !ICU_USE_THREADS
# define UMTX_FULL_BARRIER
# elif U_HAVE_GCC_ATOMICS
# define UMTX_FULL_BARRIER __sync_synchronize();
-# elif defined(U_WINDOWS) && !(defined(_MSC_VER) && !(_MSC_VER >= 1500))
+# elif defined(_MSC_VER) && _MSC_VER >= 1500
+ /* From MSVC intrin.h. Use _ReadWriteBarrier() only on MSVC 9 and higher. */
# define UMTX_FULL_BARRIER _ReadWriteBarrier();
-# elif defined(U_DARWIN)
+# elif U_PLATFORM_IS_DARWIN_BASED
# define UMTX_FULL_BARRIER OSMemoryBarrier();
# else
# define UMTX_FULL_BARRIER \
--- /dev/null
+/*
+******************************************************************************
+*
+* Copyright (C) 1997-2011, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+******************************************************************************
+*
+* FILE NAME : platform.h
+*
+* Date Name Description
+* 05/13/98 nos Creation (content moved here from ptypes.h).
+* 03/02/99 stephen Added AS400 support.
+* 03/30/99 stephen Added Linux support.
+* 04/13/99 stephen Reworked for autoconf.
+******************************************************************************
+*/
+
+#ifndef _PLATFORM_H
+#define _PLATFORM_H
+
+#include "unicode/uconfig.h"
+#include "unicode/uvernum.h"
+
+/**
+ * \file
+ * \brief Basic types for the platform.
+ *
+ * This file used to be generated by autoconf/configure.
+ * Starting with ICU 49, platform.h is a normal source file,
+ * to simplify cross-compiling and working with non-autoconf/make build systems.
+ *
+ * When a value in this file does not work on a platform, then please
+ * try to derive it from the U_PLATFORM value
+ * (for which we might need a new value constant in rare cases)
+ * and/or from other macros that are predefined by the compiler
+ * or defined in standard (POSIX or platform or compiler) headers.
+ *
+ * As a temporary workaround, you can add an explicit #define for some macros
+ * before it is first tested, or add an equivalent -D macro definition
+ * to the compiler's command line.
+ *
+ * Note: Some compilers provide ways to show the predefined macros.
+ * For example, with gcc you can compile an empty .c file and have the compiler
+ * print the predefined macros with
+ * \code
+ * gcc -E -dM -x c /dev/null | sort
+ * \endcode
+ * (You can provide an actual empty .c file rather than /dev/null.
+ * <code>-x c++</code> is for C++.)
+ */
+
+/**
+ * \def U_PLATFORM
+ * The U_PLATFORM macro defines the platform we're on.
+ *
+ * We used to define one different, value-less macro per platform.
+ * That made it hard to know the set of relevant platforms and macros,
+ * and hard to deal with variants of platforms.
+ *
+ * Starting with ICU 49, we define platforms as numeric macros,
+ * with ranges of values for related platforms and their variants.
+ * The U_PLATFORM macro is set to one of these values.
+ *
+ * Historical note from the Solaris Wikipedia article:
+ * AT&T and Sun collaborated on a project to merge the most popular Unix variants
+ * on the market at that time: BSD, System V, and Xenix.
+ * This became Unix System V Release 4 (SVR4).
+ *
+ * @internal
+ */
+
+/** Unknown platform. @internal */
+#define U_PF_UNKNOWN 0
+/** Windows @internal */
+#define U_PF_WINDOWS 1000
+/** MinGW. Windows, calls to Win32 API, but using GNU gcc and binutils. @internal */
+#define U_PF_MINGW 1800
+/**
+ * Cygwin. Windows, calls to cygwin1.dll for Posix functions,
+ * using MSVC or GNU gcc and binutils.
+ * @internal
+ */
+#define U_PF_CYGWIN 1900
+/* Reserve 2000 for U_PF_UNIX? */
+/** HP-UX is based on UNIX System V. @internal */
+#define U_PF_HPUX 2100
+/** Solaris is a Unix operating system based on SVR4. @internal */
+#define U_PF_SOLARIS 2600
+/** BSD is a UNIX operating system derivative. @internal */
+#define U_PF_BSD 3000
+/** AIX is based on UNIX System V Releases and 4.3 BSD. @internal */
+#define U_PF_AIX 3100
+/** IRIX is based on UNIX System V with BSD extensions. @internal */
+#define U_PF_IRIX 3200
+/**
+ * Darwin is a POSIX-compliant operating system, composed of code developed by Apple,
+ * as well as code derived from NeXTSTEP, BSD, and other projects,
+ * built around the Mach kernel.
+ * Darwin forms the core set of components upon which Mac OS X, Apple TV, and iOS are based.
+ * (Original description modified from WikiPedia.)
+ * @internal
+ */
+#define U_PF_DARWIN 3500
+/** iPhone OS (iOS) is a derivative of Mac OS X. @internal */
+#define U_PF_IPHONE 3550
+/** QNX is a commercial Unix-like real-time operating system related to BSD. @internal */
+#define U_PF_QNX 3700
+/** Linux is a Unix-like operating system. @internal */
+#define U_PF_LINUX 4000
+/** Android is based on Linux. @internal */
+#define U_PF_ANDROID 4050
+/** "Classic" Mac OS (1984–2001) @internal */
+#define U_PF_CLASSIC_MACOS 8000
+/** z/OS is the successor to OS/390 which was the successor to MVS. @internal */
+#define U_PF_OS390 9000
+/** "IBM i" is the current name of what used to be i5/OS and earlier OS/400. @internal */
+#define U_PF_OS400 9400
+
+#ifdef U_PLATFORM
+ /* Use the predefined value. */
+#elif defined(__MINGW32__)
+# define U_PLATFORM U_PF_MINGW
+#elif defined(__CYGWIN__)
+# define U_PLATFORM U_PF_CYGWIN
+#elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
+# define U_PLATFORM U_PF_WINDOWS
+#elif defined(__ANDROID__)
+# define U_PLATFORM U_PF_ANDROID
+ /* Android wchar_t support depends on the API level. */
+# include <android/api-level.h>
+#elif defined(linux) || defined(__linux__) || defined(__linux)
+# define U_PLATFORM U_PF_LINUX
+#elif defined(BSD)
+# define U_PLATFORM U_PF_BSD
+#elif defined(sun) || defined(__sun)
+ /* Check defined(__SVR4) || defined(__svr4__) to distinguish Solaris from SunOS? */
+# define U_PLATFORM U_PF_SOLARIS
+#elif defined(_AIX) || defined(__TOS_AIX__)
+# define U_PLATFORM U_PF_AIX
+#elif defined(_hpux) || defined(hpux) || defined(__hpux)
+# define U_PLATFORM U_PF_HPUX
+#elif defined(sgi) || defined(__sgi)
+# define U_PLATFORM U_PF_IRIX
+#elif defined(__APPLE__) && defined(__MACH__)
+# include <TargetConditionals.h>
+# ifdef TARGET_OS_IPHONE /* variant of TARGET_OS_MAC */
+# define U_PLATFORM U_PF_IPHONE
+# else
+# define U_PLATFORM U_PF_DARWIN
+# endif
+#elif defined(macintosh)
+# define U_PLATFORM U_PF_CLASSIC_MACOS
+#elif defined(__QNX__) || defined(__QNXNTO__)
+# define U_PLATFORM U_PF_QNX
+#elif defined(__TOS_MVS__)
+# define U_PLATFORM U_PF_OS390
+#elif defined(__OS400__) || defined(__TOS_OS400__)
+# define U_PLATFORM U_PF_OS400
+#else
+# define U_PLATFORM U_PF_UNKNOWN
+#endif
+
+/**
+ * \def U_PLATFORM_USES_ONLY_WIN32_API
+ * Defines whether the platform uses only the Win32 API.
+ * Set to 1 for Windows/MSVC and MinGW but not Cygwin.
+ * @internal
+ */
+#ifdef U_PLATFORM_USES_ONLY_WIN32_API
+ /* Use the predefined value. */
+#elif U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_MINGW
+# define U_PLATFORM_USES_ONLY_WIN32_API 1
+#else
+ /* Cygwin implements POSIX. */
+# define U_PLATFORM_USES_ONLY_WIN32_API 0
+#endif
+
+/**
+ * \def U_PLATFORM_HAS_WIN32_API
+ * Defines whether the Win32 API is available on the platform.
+ * Set to 1 for Windows/MSVC, MinGW and Cygwin.
+ * @internal
+ */
+#ifdef U_PLATFORM_HAS_WIN32_API
+ /* Use the predefined value. */
+#elif U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
+# define U_PLATFORM_HAS_WIN32_API 1
+#else
+# define U_PLATFORM_HAS_WIN32_API 0
+#endif
+
+/**
+ * \def U_PLATFORM_IMPLEMENTS_POSIX
+ * Defines whether the platform implements (most of) the POSIX API.
+ * Set to 1 for Cygwin and most other platforms.
+ * @internal
+ */
+#ifdef U_PLATFORM_IMPLEMENTS_POSIX
+ /* Use the predefined value. */
+#elif U_PLATFORM_USES_ONLY_WIN32_API || U_PLATFORM == U_PF_CLASSIC_MACOS
+# define U_PLATFORM_IMPLEMENTS_POSIX 0
+#else
+# define U_PLATFORM_IMPLEMENTS_POSIX 1
+#endif
+
+/**
+ * \def CYGWINMSVC
+ * Defined if this is Windows with Cygwin, but using MSVC rather than gcc.
+ * Otherwise undefined.
+ * @internal
+ */
+#if U_PLATFORM == U_PF_CYGWIN && defined(_MSC_VER)
+# define CYGWINMSVC
+#endif
+
+/**
+ * \def U_PLATFORM_IS_LINUX_BASED
+ * Defines whether the platform is Linux or one of its derivatives.
+ * @internal
+ */
+#ifdef U_PLATFORM_IS_LINUX_BASED
+ /* Use the predefined value. */
+#elif U_PF_LINUX <= U_PLATFORM && U_PLATFORM <= U_PF_ANDROID
+# define U_PLATFORM_IS_LINUX_BASED 1
+#else
+# define U_PLATFORM_IS_LINUX_BASED 0
+#endif
+
+/**
+ * \def U_PLATFORM_IS_DARWIN_BASED
+ * Defines whether the platform is Darwin or one of its derivatives.
+ * @internal
+ */
+#ifdef U_PLATFORM_IS_DARWIN_BASED
+ /* Use the predefined value. */
+#elif U_PF_DARWIN <= U_PLATFORM && U_PLATFORM <= U_PF_IPHONE
+# define U_PLATFORM_IS_DARWIN_BASED 1
+#else
+# define U_PLATFORM_IS_DARWIN_BASED 0
+#endif
+
+/**
+ * \def U_HAVE_DIRENT_H
+ * Defines whether dirent.h is available.
+ * @internal
+ */
+#ifdef U_HAVE_DIRENT_H
+ /* Use the predefined value. */
+#elif U_PLATFORM_HAS_WIN32_API
+# define U_HAVE_DIRENT_H 0
+#else
+# define U_HAVE_DIRENT_H 1
+#endif
+
+/**
+ * \def U_HAVE_STDINT_H
+ * Defines whether stdint.h is available. It is a C99 standard header.
+ * We used to include inttypes.h which includes stdint.h but we usually do not need
+ * the additional definitions from inttypes.h.
+ * @internal
+ */
+#ifdef U_HAVE_STDINT_H
+ /* Use the predefined value. */
+#elif U_PLATFORM_USES_ONLY_WIN32_API
+# if defined(__BORLANDC__) || (defined(_MSC_VER) && _MSC_VER>=1600)
+ /* Windows Visual Studio 9 and below do not have stdint.h & inttypes.h, but VS 2010 adds them. */
+# define U_HAVE_STDINT_H 1
+# else
+# define U_HAVE_STDINT_H 0
+# endif
+#elif U_PLATFORM == U_PF_SOLARIS
+ /* Solaris has inttypes.h but not stdint.h. */
+# define U_HAVE_STDINT_H 0
+#else
+# define U_HAVE_STDINT_H 1
+#endif
+
+/**
+ * \def U_HAVE_INTTYPES_H
+ * Defines whether inttypes.h is available. It is a C99 standard header.
+ * We include inttypes.h where it is available but stdint.h is not.
+ * @internal
+ */
+#ifdef U_HAVE_INTTYPES_H
+ /* Use the predefined value. */
+#elif U_PLATFORM == U_PF_SOLARIS
+ /* Solaris has inttypes.h but not stdint.h. */
+# define U_HAVE_INTTYPES_H 1
+#else
+ /* Most platforms have both inttypes.h and stdint.h, or neither. */
+# define U_HAVE_INTTYPES_H U_HAVE_STDINT_H
+#endif
+
+/**
+ * \def U_IOSTREAM_SOURCE
+ * Defines what support for C++ streams is available.
+ *
+ * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available
+ * (the ISO/IEC C++ FDIS was published in November 1997), and then
+ * one should qualify streams using the std namespace in ICU header
+ * files.
+ * Starting with ICU 49, this is the only supported version.
+ *
+ * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is
+ * available instead (in June 1985 Stroustrup published
+ * "An Extensible I/O Facility for C++" at the summer USENIX conference).
+ * Starting with ICU 49, this version is not supported any more.
+ *
+ * If U_IOSTREAM_SOURCE is 0 (or any value less than 199711),
+ * then C++ streams are not available and
+ * support for them will be silently suppressed in ICU.
+ *
+ * @internal
+ */
+#ifndef U_IOSTREAM_SOURCE
+#define U_IOSTREAM_SOURCE 199711
+#endif
+
+/**
+ * \def U_HAVE_STD_STRING
+ * Defines whether the standard C++ (STL) <string> header is available.
+ * @internal
+ */
+#ifdef U_HAVE_STD_STRING
+ /* Use the predefined value. */
+#elif U_PLATFORM == U_PF_ANDROID
+# define U_HAVE_STD_STRING 0
+#else
+# define U_HAVE_STD_STRING 1
+#endif
+
+/*===========================================================================*/
+/** @{ Compiler and environment features */
+/*===========================================================================*/
+
+/**
+ * \def U_IS_BIG_ENDIAN
+ * Determines the endianness of the platform.
+ * @internal
+ */
+#ifdef U_IS_BIG_ENDIAN
+ /* Use the predefined value. */
+#elif defined(BYTE_ORDER) && defined(BIG_ENDIAN)
+# define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
+#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__)
+ /* gcc */
+# define U_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
+#elif defined(__BIG_ENDIAN__) || defined(_BIG_ENDIAN)
+# define U_IS_BIG_ENDIAN 1
+#elif defined(__LITTLE_ENDIAN__) || defined(_LITTLE_ENDIAN)
+# define U_IS_BIG_ENDIAN 0
+#elif U_PLATFORM == U_PF_OS390 || U_PLATFORM == U_PF_OS400
+ /* These platforms do not appear to predefine any endianness macros. */
+# define U_IS_BIG_ENDIAN 1
+#else
+# define U_IS_BIG_ENDIAN 0
+#endif
+
+/**
+ * \def U_HAVE_PLACEMENT_NEW
+ * Determines whether to override placement new and delete for STL.
+ * @stable ICU 2.6
+ */
+#ifdef U_HAVE_PLACEMENT_NEW
+ /* Use the predefined value. */
+#elif defined(__BORLANDC__)
+# define U_HAVE_PLACEMENT_NEW 0
+#else
+# define U_HAVE_PLACEMENT_NEW 1
+#endif
+
+/**
+ * \def U_HAVE_DEBUG_LOCATION_NEW
+ * Define this to define the MFC debug version of the operator new.
+ *
+ * @stable ICU 3.4
+ */
+#ifdef U_HAVE_DEBUG_LOCATION_NEW
+ /* Use the predefined value. */
+#elif defined(_MSC_VER)
+# define U_HAVE_DEBUG_LOCATION_NEW 1
+#else
+# define U_HAVE_DEBUG_LOCATION_NEW 0
+#endif
+
+/** @} */
+
+/*===========================================================================*/
+/** @{ Character data types */
+/*===========================================================================*/
+
+/**
+ * U_CHARSET_FAMILY is equal to this value when the platform is an ASCII based platform.
+ * @stable ICU 2.0
+ */
+#define U_ASCII_FAMILY 0
+
+/**
+ * U_CHARSET_FAMILY is equal to this value when the platform is an EBCDIC based platform.
+ * @stable ICU 2.0
+ */
+#define U_EBCDIC_FAMILY 1
+
+/**
+ * \def U_CHARSET_FAMILY
+ *
+ * <p>These definitions allow to specify the encoding of text
+ * in the char data type as defined by the platform and the compiler.
+ * It is enough to determine the code point values of "invariant characters",
+ * which are the ones shared by all encodings that are in use
+ * on a given platform.</p>
+ *
+ * <p>Those "invariant characters" should be all the uppercase and lowercase
+ * latin letters, the digits, the space, and "basic punctuation".
+ * Also, '\\n', '\\r', '\\t' should be available.</p>
+ *
+ * <p>The list of "invariant characters" is:<br>
+ * \code
+ * A-Z a-z 0-9 SPACE " % & ' ( ) * + , - . / : ; < = > ? _
+ * \endcode
+ * <br>
+ * (52 letters + 10 numbers + 20 punc/sym/space = 82 total)</p>
+ *
+ * <p>This matches the IBM Syntactic Character Set (CS 640).</p>
+ *
+ * <p>In other words, all the graphic characters in 7-bit ASCII should
+ * be safely accessible except the following:</p>
+ *
+ * \code
+ * '\' <backslash>
+ * '[' <left bracket>
+ * ']' <right bracket>
+ * '{' <left brace>
+ * '}' <right brace>
+ * '^' <circumflex>
+ * '~' <tilde>
+ * '!' <exclamation mark>
+ * '#' <number sign>
+ * '|' <vertical line>
+ * '$' <dollar sign>
+ * '@' <commercial at>
+ * '`' <grave accent>
+ * \endcode
+ * @stable ICU 2.0
+ */
+#ifdef U_CHARSET_FAMILY
+ /* Use the predefined value. */
+#elif U_PLATFORM == U_PF_OS390 && (!defined(__CHARSET_LIB) || !__CHARSET_LIB)
+# define U_CHARSET_FAMILY U_EBCDIC_FAMILY
+#elif U_PLATFORM == U_PF_OS400 && !defined(__UTF32__)
+# define U_CHARSET_FAMILY U_EBCDIC_FAMILY
+#else
+# define U_CHARSET_FAMILY U_ASCII_FAMILY
+#endif
+
+/**
+ * \def U_CHARSET_IS_UTF8
+ *
+ * Hardcode the default charset to UTF-8.
+ *
+ * If this is set to 1, then
+ * - ICU will assume that all non-invariant char*, StringPiece, std::string etc.
+ * contain UTF-8 text, regardless of what the system API uses
+ * - some ICU code will use fast functions like u_strFromUTF8()
+ * rather than the more general and more heavy-weight conversion API (ucnv.h)
+ * - ucnv_getDefaultName() always returns "UTF-8"
+ * - ucnv_setDefaultName() is disabled and will not change the default charset
+ * - static builds of ICU are smaller
+ * - more functionality is available with the UCONFIG_NO_CONVERSION build-time
+ * configuration option (see unicode/uconfig.h)
+ * - the UCONFIG_NO_CONVERSION build option in uconfig.h is more usable
+ *
+ * @stable ICU 4.2
+ * @see UCONFIG_NO_CONVERSION
+ */
+#ifndef U_CHARSET_IS_UTF8
+# define U_CHARSET_IS_UTF8 0
+#endif
+
+/** @} */
+
+/*===========================================================================*/
+/** @{ Information about wchar support */
+/*===========================================================================*/
+
+/**
+ * \def U_HAVE_WCHAR_H
+ * Indicates whether <wchar.h> is available (1) or not (0). Set to 1 by default.
+ *
+ * @stable ICU 2.0
+ */
+#ifdef U_HAVE_WCHAR_H
+ /* Use the predefined value. */
+#elif U_PLATFORM == U_PF_ANDROID && __ANDROID_API__ < 9
+ /*
+ * Android before Gingerbread (Android 2.3, API level 9) did not support wchar_t.
+ * The type and header existed, but the library functions did not work as expected.
+ * The size of wchar_t was 1 but L"xyz" string literals had 32-bit units anyway.
+ */
+# define U_HAVE_WCHAR_H 0
+#else
+# define U_HAVE_WCHAR_H 1
+#endif
+
+/**
+ * \def U_SIZEOF_WCHAR_T
+ * U_SIZEOF_WCHAR_T==sizeof(wchar_t)
+ *
+ * @stable ICU 2.0
+ */
+#ifdef U_SIZEOF_WCHAR_T
+ /* Use the predefined value. */
+#elif (U_PLATFORM == U_PF_ANDROID && __ANDROID_API__ < 9) || U_PLATFORM == U_PF_CLASSIC_MACOS
+ /*
+ * Classic Mac OS and Mac OS X before 10.3 (Panther) did not support wchar_t or wstring.
+ * Newer Mac OS X has size 4.
+ */
+# define U_SIZEOF_WCHAR_T 1
+#elif U_PLATFORM_HAS_WIN32_API
+# define U_SIZEOF_WCHAR_T 2
+#elif U_PLATFORM == U_PF_AIX
+ /*
+ * AIX 6.1 information, section "Wide character data representation":
+ * "... the wchar_t datatype is 32–bit in the 64–bit environment and
+ * 16–bit in the 32–bit environment."
+ * and
+ * "All locales use Unicode for their wide character code values (process code),
+ * except the IBM-eucTW codeset."
+ */
+# ifdef __64BIT__
+# define U_SIZEOF_WCHAR_T 4
+# else
+# define U_SIZEOF_WCHAR_T 2
+# endif
+#elif U_PLATFORM == U_PF_OS390
+ /*
+ * z/OS V1R11 information center, section "LP64 | ILP32":
+ * "In 31-bit mode, the size of long and pointers is 4 bytes and the size of wchar_t is 2 bytes.
+ * Under LP64, the size of long and pointer is 8 bytes and the size of wchar_t is 4 bytes."
+ */
+# ifdef _LP64
+# define U_SIZEOF_WCHAR_T 4
+# else
+# define U_SIZEOF_WCHAR_T 2
+# endif
+#elif U_PLATFORM == U_PF_OS400
+# if defined(__UTF32__)
+ /*
+ * LOCALETYPE(*LOCALEUTF) is specified.
+ * Wide-character strings are in UTF-32,
+ * narrow-character strings are in UTF-8.
+ */
+# define U_SIZEOF_WCHAR_T 4
+# elif defined(__UCS2__)
+ /*
+ * LOCALETYPE(*LOCALEUCS2) is specified.
+ * Wide-character strings are in UCS-2,
+ * narrow-character strings are in EBCDIC.
+ */
+# define U_SIZEOF_WCHAR_T 2
+#else
+ /*
+ * LOCALETYPE(*CLD) or LOCALETYPE(*LOCALE) is specified.
+ * Wide-character strings are in 16-bit EBCDIC,
+ * narrow-character strings are in EBCDIC.
+ */
+# define U_SIZEOF_WCHAR_T 2
+# endif
+#else
+# define U_SIZEOF_WCHAR_T 4
+#endif
+
+#ifndef U_HAVE_WCSCPY
+#define U_HAVE_WCSCPY U_HAVE_WCHAR_H
+#endif
+
+/** @} */
+
+/**
+ * \def U_HAVE_CHAR16_T
+ * Defines whether the char16_t type is available for UTF-16
+ * and u"abc" UTF-16 string literals are supported.
+ * This is a new standard type and standard string literal syntax in C++0x
+ * but has been available in some compilers before.
+ * @internal
+ */
+#ifdef U_HAVE_CHAR16_T
+ /* Use the predefined value. */
+#else
+ /*
+ * Notes:
+ * Visual Studio 10 (_MSC_VER>=1600) defines char16_t but
+ * does not support u"abc" string literals.
+ * gcc 4.4 defines the __CHAR16_TYPE__ macro to a usable type but
+ * does not support u"abc" string literals.
+ */
+# define U_HAVE_CHAR16_T 0
+#endif
+
+/**
+ * @{
+ * \def U_DECLARE_UTF16
+ * Do not use this macro because it is not defined on all platforms.
+ * Use the UNICODE_STRING or U_STRING_DECL macros instead.
+ * @internal
+ */
+#ifdef U_DECLARE_UTF16
+ /* Use the predefined value. */
+#elif (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
+ || (defined(__HP_aCC) && __HP_aCC >= 035000) \
+ || (defined(__HP_cc) && __HP_cc >= 111106) \
+ || U_HAVE_CHAR16_T
+# define U_DECLARE_UTF16(string) u ## string
+#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
+/* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
+/* Sun's C compiler has issues with this notation, and it's unreliable. */
+# define U_DECLARE_UTF16(string) U ## string
+#elif U_SIZEOF_WCHAR_T == 2 \
+ && (U_CHARSET_FAMILY == 0 || (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400 && defined(__UCS2__)))
+# define U_DECLARE_UTF16(string) L ## string
+#else
+ /* Leave U_DECLARE_UTF16 undefined. See unistr.h. */
+#endif
+
+/** @} */
+
+/*===========================================================================*/
+/** @{ Information about POSIX support */
+/*===========================================================================*/
+
+#ifdef U_HAVE_NL_LANGINFO_CODESET
+ /* Use the predefined value. */
+#elif U_PLATFORM_HAS_WIN32_API
+# define U_HAVE_NL_LANGINFO_CODESET 0
+#else
+# define U_HAVE_NL_LANGINFO_CODESET 1
+#endif
+
+#ifdef U_NL_LANGINFO_CODESET
+ /* Use the predefined value. */
+#elif !U_HAVE_NL_LANGINFO_CODESET
+# define U_NL_LANGINFO_CODESET -1
+#else
+# define U_NL_LANGINFO_CODESET CODESET
+#endif
+
+#ifdef U_TZSET
+ /* Use the predefined value. */
+#elif U_PLATFORM_HAS_WIN32_API
+# define U_TZSET _tzset
+#else
+# define U_TZSET tzset
+#endif
+
+#ifdef U_TIMEZONE
+ /* Use the predefined value. */
+#elif U_PLATFORM_IS_LINUX_BASED
+# define U_TIMEZONE __timezone
+#elif U_PLATFORM_HAS_WIN32_API
+# define U_TIMEZONE _timezone
+#else
+# define U_TIMEZONE timezone
+#endif
+
+#ifdef U_TZNAME
+ /* Use the predefined value. */
+#elif U_PLATFORM_HAS_WIN32_API
+# define U_TZNAME _tzname
+#else
+# define U_TZNAME tzname
+#endif
+
+#ifdef U_HAVE_MMAP
+ /* Use the predefined value. */
+#elif U_PLATFORM_HAS_WIN32_API
+# define U_HAVE_MMAP 0
+#else
+# define U_HAVE_MMAP 1
+#endif
+
+#ifdef U_HAVE_POPEN
+ /* Use the predefined value. */
+#elif U_PLATFORM_HAS_WIN32_API
+# define U_HAVE_POPEN 0
+#else
+# define U_HAVE_POPEN 1
+#endif
+
+/** @} */
+
+/*===========================================================================*/
+/** @{ Symbol import-export control */
+/*===========================================================================*/
+
+#ifdef U_EXPORT
+ /* Use the predefined value. */
+#elif defined(U_STATIC_IMPLEMENTATION)
+# define U_EXPORT
+#elif defined(__GNUC__)
+# define U_EXPORT __attribute__((visibility("default")))
+#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
+ || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
+# define U_EXPORT __global
+/*#elif defined(__HP_aCC) || defined(__HP_cc)
+# define U_EXPORT __declspec(dllexport)*/
+#elif defined(_MSC_VER)
+# define U_EXPORT __declspec(dllexport)
+#else
+# define U_EXPORT
+#endif
+
+/* U_CALLCONV is releated to U_EXPORT2 */
+#ifdef U_EXPORT2
+ /* Use the predefined value. */
+#elif defined(_MSC_VER)
+# define U_EXPORT2 __cdecl
+#else
+# define U_EXPORT2
+#endif
+
+#ifdef U_IMPORT
+ /* Use the predefined value. */
+#elif defined(_MSC_VER)
+ /* Windows needs to export/import data. */
+# define U_IMPORT __declspec(dllimport)
+#else
+# define U_IMPORT
+#endif
+
+/**
+ * \def U_CALLCONV
+ * Similar to U_CDECL_BEGIN/U_CDECL_END, this qualifier is necessary
+ * in callback function typedefs to make sure that the calling convention
+ * is compatible.
+ *
+ * This is only used for non-ICU-API functions.
+ * When a function is a public ICU API,
+ * you must use the U_CAPI and U_EXPORT2 qualifiers.
+ * @stable ICU 2.0
+ */
+#if U_PLATFORM == U_PF_OS390 && defined(__cplusplus)
+# define U_CALLCONV __cdecl
+#else
+# define U_CALLCONV U_EXPORT2
+#endif
+
+/* @} */
+
+/*===========================================================================*/
+/** @{ Code alignment */
+/*===========================================================================*/
+
+/**
+ * \def U_ALIGN_CODE
+ * This is used to align code fragments to a specific byte boundary.
+ * This is useful for getting consistent performance test results.
+ * @internal
+ */
+#ifdef U_ALIGN_CODE
+ /* Use the predefined value. */
+#elif defined(_MSC_VER) && defined(_M_IX86) && !defined(_MANAGED)
+# define U_ALIGN_CODE(boundarySize) __asm align boundarySize
+#else
+# define U_ALIGN_CODE(boundarySize)
+#endif
+
+/** @} */
+
+/**
+ * \def U_HAVE_MSVC_2003_OR_EARLIER
+ * Flag for workaround of MSVC 2003 optimization bugs
+ * @internal
+ */
+#if !defined(U_HAVE_MSVC_2003_OR_EARLIER) && defined(_MSC_VER) && (_MSC_VER < 1400)
+#define U_HAVE_MSVC_2003_OR_EARLIER
+#endif
+
+/*===========================================================================*/
+/** @{ GCC built in functions for atomic memory operations */
+/*===========================================================================*/
+
+/**
+ * \def U_HAVE_GCC_ATOMICS
+ * @internal
+ */
+#ifdef U_HAVE_GCC_ATOMICS
+ /* Use the predefined value. */
+#elif defined(__GNUC__)
+# define U_HAVE_GCC_ATOMICS 1
+#else
+# define U_HAVE_GCC_ATOMICS 0
+#endif
+
+/** @} */
+
+/*===========================================================================*/
+/** @{ Programs used by ICU code */
+/*===========================================================================*/
+
+/**
+ * \def U_MAKE_IS_NMAKE
+ * Defines whether the "make" program is Windows nmake.
+ */
+#ifdef U_MAKE_IS_NMAKE
+ /* Use the predefined value. */
+#elif U_PLATFORM == U_PF_WINDOWS
+# define U_MAKE_IS_NMAKE 1
+#else
+# define U_MAKE_IS_NMAKE 0
+#endif
+
+/** @} */
+
+/*===========================================================================*/
+/* Custom icu entry point renaming */
+/*===========================================================================*/
+
+#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 ## _ ## U_ICU_VERSION_MAJOR_NUM ## U_LIB_SUFFIX_C_NAME
+# define U_DEF_ICUDATA_ENTRY_POINT(major) icudt ## U_LIB_SUFFIX_C_NAME ## major ##_dat
+
+# endif
+#endif
+
+#endif
+++ /dev/null
-/*
-******************************************************************************
-*
-* Copyright (C) 1997-2011, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-******************************************************************************
-*
-* Note: autoconf creates platform.h from platform.h.in at configure time.
-*
-******************************************************************************
-*
-* FILE NAME : platform.h
-*
-* Date Name Description
-* 05/13/98 nos Creation (content moved here from ptypes.h).
-* 03/02/99 stephen Added AS400 support.
-* 03/30/99 stephen Added Linux support.
-* 04/13/99 stephen Reworked for autoconf.
-******************************************************************************
-*/
-
-#ifndef _PLATFORM_H
-#define _PLATFORM_H
-
-/**
- * \file
- * \brief Basic types for the platform
- */
-
-/* This file should be included before uvernum.h. */
-#if defined(UVERNUM_H)
-# error Do not include unicode/uvernum.h before #including unicode/platform.h. Instead of unicode/uvernum.h, #include unicode/uversion.h
-#endif
-
-/**
- * Determine wheter to enable auto cleanup of libraries.
- * @internal
- */
-#ifndef UCLN_NO_AUTO_CLEANUP
-#define UCLN_NO_AUTO_CLEANUP @UCLN_NO_AUTO_CLEANUP@
-#endif
-
-#if @U_USING_CYGWIN_MSVC@
-#define CYGWINMSVC
-#endif
-
-/* Need platform.h when using CYGWINMSVC to get definitions above. Ignore everything else. */
-#ifndef CYGWINMSVC
-
-/** Define the platform we're on. */
-#ifndef @platform@
-#define @platform@
-#endif
-
-/**
- * \def U_HAVE_DIRENT_H
- * Define whether dirent.h is available
- * @internal
- */
-#ifndef U_HAVE_DIRENT_H
-#define U_HAVE_DIRENT_H @U_HAVE_DIRENT_H@
-#endif
-
-/** Define whether inttypes.h is available */
-#ifndef U_HAVE_INTTYPES_H
-#define U_HAVE_INTTYPES_H @U_HAVE_INTTYPES_H@
-#endif
-
-/**
- * Define what support for C++ streams is available.
- *
- * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available
- * (the ISO/IEC C++ FDIS was published in November 1997), and then
- * one should qualify streams using the std namespace in ICU header
- * files.
- * Starting with ICU 49, this is the only supported version.
- *
- * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is
- * available instead (in June 1985 Stroustrup published
- * "An Extensible I/O Facility for C++" at the summer USENIX conference).
- * Starting with ICU 49, this version is not supported any more.
- *
- * If U_IOSTREAM_SOURCE is 0 (or any value less than 199711),
- * then C++ streams are not available and
- * support for them will be silently suppressed in ICU.
- */
-#ifndef U_IOSTREAM_SOURCE
-#define U_IOSTREAM_SOURCE 199711
-#endif
-
-/**
- * \def U_HAVE_STD_STRING
- * Define whether the standard C++ (STL) <string> header is available.
- * For platforms that do not use platform.h and do not define this constant
- * in their platform-specific headers, std_string.h defaults
- * U_HAVE_STD_STRING to 1.
- * @internal
- */
-#ifndef U_HAVE_STD_STRING
-#define U_HAVE_STD_STRING @U_HAVE_STD_STRING@
-#endif
-
-/** @{ Determines whether specific types are available */
-#ifndef U_HAVE_INT8_T
-#define U_HAVE_INT8_T @HAVE_INT8_T@
-#endif
-
-#ifndef U_HAVE_UINT8_T
-#define U_HAVE_UINT8_T @HAVE_UINT8_T@
-#endif
-
-#ifndef U_HAVE_INT16_T
-#define U_HAVE_INT16_T @HAVE_INT16_T@
-#endif
-
-#ifndef U_HAVE_UINT16_T
-#define U_HAVE_UINT16_T @HAVE_UINT16_T@
-#endif
-
-#ifndef U_HAVE_INT32_T
-#define U_HAVE_INT32_T @HAVE_INT32_T@
-#endif
-
-#ifndef U_HAVE_UINT32_T
-#define U_HAVE_UINT32_T @HAVE_UINT32_T@
-#endif
-
-#ifndef U_HAVE_INT64_T
-#define U_HAVE_INT64_T @HAVE_INT64_T@
-#endif
-
-#ifndef U_HAVE_UINT64_T
-#define U_HAVE_UINT64_T @HAVE_UINT64_T@
-#endif
-
-/** @} */
-
-/*===========================================================================*/
-/** @{ Compiler and environment features */
-/*===========================================================================*/
-
-/* Determines the endianness of the platform
- It's done this way in case multiple architectures are being built at once.
- For example, Darwin supports fat binaries, which can be both PPC and x86 based. */
-#if defined(BYTE_ORDER) && defined(BIG_ENDIAN)
-#define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
-#else
-#define U_IS_BIG_ENDIAN @U_IS_BIG_ENDIAN@
-#endif
-
-/* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
-#ifndef ICU_USE_THREADS
-#define ICU_USE_THREADS @ICU_USE_THREADS@
-#endif
-
-#ifndef U_DEBUG
-#define U_DEBUG @ENABLE_DEBUG@
-#endif
-
-#ifndef U_RELEASE
-#define U_RELEASE @ENABLE_RELEASE@
-#endif
-
-/* Determine whether to disable renaming or not. This overrides the
- setting in umachine.h which is for all platforms. */
-#ifndef U_DISABLE_RENAMING
-#define U_DISABLE_RENAMING @U_DISABLE_RENAMING@
-#endif
-
-/* Determine whether to override new and delete. */
-#ifndef U_OVERRIDE_CXX_ALLOCATION
-#define U_OVERRIDE_CXX_ALLOCATION @U_OVERRIDE_CXX_ALLOCATION@
-#endif
-/* Determine whether to override placement new and delete for STL. */
-#ifndef U_HAVE_PLACEMENT_NEW
-#define U_HAVE_PLACEMENT_NEW @U_HAVE_PLACEMENT_NEW@
-#endif
-
-/* Determine whether to enable tracing. */
-#ifndef U_ENABLE_TRACING
-#define U_ENABLE_TRACING @U_ENABLE_TRACING@
-#endif
-
-/**
- * Whether to enable Dynamic loading in ICU
- * @internal
- */
-#ifndef U_ENABLE_DYLOAD
-#define U_ENABLE_DYLOAD @U_ENABLE_DYLOAD@
-#endif
-
-/**
- * Whether to test Dynamic loading as an OS capabilty
- * @internal
- */
-#ifndef U_CHECK_DYLOAD
-#define U_CHECK_DYLOAD @U_CHECK_DYLOAD@
-#endif
-
-
-/** Do we allow ICU users to use the draft APIs by default? */
-#ifndef U_DEFAULT_SHOW_DRAFT
-#define U_DEFAULT_SHOW_DRAFT @U_DEFAULT_SHOW_DRAFT@
-#endif
-
-/** @} */
-
-/*===========================================================================*/
-/** @{ Character data types */
-/*===========================================================================*/
-
-#if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
-# define U_CHARSET_FAMILY 1
-#endif
-
-/** @} */
-
-/*===========================================================================*/
-/** @{ Information about wchar support */
-/*===========================================================================*/
-
-#ifndef U_HAVE_WCHAR_H
-#define U_HAVE_WCHAR_H @U_HAVE_WCHAR_H@
-#endif
-
-#ifndef U_SIZEOF_WCHAR_T
-#define U_SIZEOF_WCHAR_T @U_SIZEOF_WCHAR_T@
-#endif
-
-#ifndef U_HAVE_WCSCPY
-#define U_HAVE_WCSCPY @U_HAVE_WCSCPY@
-#endif
-
-/** @} */
-
-/**
- * @{
- * \def U_DECLARE_UTF16
- * Do not use this macro. Use the UNICODE_STRING or U_STRING_DECL macros
- * instead.
- * @internal
- *
- * \def U_GNUC_UTF16_STRING
- * @internal
- */
-#ifndef U_GNUC_UTF16_STRING
-#define U_GNUC_UTF16_STRING @U_CHECK_GNUC_UTF16_STRING@
-#endif
-#if @U_CHECK_UTF16_STRING@ || defined(U_CHECK_UTF16_STRING)
-#if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
- || (defined(__HP_aCC) && __HP_aCC >= 035000) \
- || (defined(__HP_cc) && __HP_cc >= 111106) \
- || U_GNUC_UTF16_STRING
-#define U_DECLARE_UTF16(string) u ## string
-#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
-/* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
-/* Sun's C compiler has issues with this notation, and it's unreliable. */
-#define U_DECLARE_UTF16(string) U ## string
-#elif U_SIZEOF_WCHAR_T == 2 \
- && (U_CHARSET_FAMILY == 0 || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
-#define U_DECLARE_UTF16(string) L ## string
-#endif
-#endif
-
-/** @} */
-
-/*===========================================================================*/
-/** @{ Information about POSIX support */
-/*===========================================================================*/
-
-#ifndef U_HAVE_NL_LANGINFO_CODESET
-#define U_HAVE_NL_LANGINFO_CODESET @U_HAVE_NL_LANGINFO_CODESET@
-#endif
-
-#ifndef U_NL_LANGINFO_CODESET
-#define U_NL_LANGINFO_CODESET @U_NL_LANGINFO_CODESET@
-#endif
-
-#if @U_HAVE_TZSET@
-#define U_TZSET @U_TZSET@
-#endif
-#if @U_HAVE_TIMEZONE@
-#define U_TIMEZONE @U_TIMEZONE@
-#endif
-#if @U_HAVE_TZNAME@
-#define U_TZNAME @U_TZNAME@
-#endif
-
-#define U_HAVE_MMAP @HAVE_MMAP@
-#define U_HAVE_POPEN @U_HAVE_POPEN@
-
-/** @} */
-
-/*===========================================================================*/
-/** @{ Symbol import-export control */
-/*===========================================================================*/
-
-#ifdef U_STATIC_IMPLEMENTATION
-#define U_EXPORT
-#elif @U_USE_GCC_VISIBILITY_ATTRIBUTE@
-#define U_EXPORT __attribute__((visibility("default")))
-#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
- || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
-#define U_EXPORT __global
-/*#elif defined(__HP_aCC) || defined(__HP_cc)
-#define U_EXPORT __declspec(dllexport)*/
-#else
-#define U_EXPORT
-#endif
-
-/* U_CALLCONV is releated to U_EXPORT2 */
-#define U_EXPORT2
-
-/* cygwin needs to export/import data */
-#if defined(U_CYGWIN) && !defined(__GNUC__)
-#define U_IMPORT __declspec(dllimport)
-#else
-#define U_IMPORT
-#endif
-
-/* @} */
-
-/*===========================================================================*/
-/** @{ Code alignment */
-/*===========================================================================*/
-
-#ifndef U_ALIGN_CODE
-#define U_ALIGN_CODE(n)
-#endif
-
-/** @} */
-
-/*===========================================================================*/
-/** @{ GCC built in functions for atomic memory operations */
-/*===========================================================================*/
-
-/**
- * \def U_HAVE_GCC_ATOMICS
- * @internal
- */
-#ifndef U_HAVE_GCC_ATOMICS
-#define U_HAVE_GCC_ATOMICS @U_HAVE_GCC_ATOMICS@
-#endif
-
-/** @} */
-
-/*===========================================================================*/
-/** @{ Programs used by ICU code */
-/*===========================================================================*/
-
-/**
- * \def U_MAKE
- * What program to execute to run 'make'
- */
-#ifndef U_MAKE
-#define U_MAKE "@U_MAKE@"
-#endif
-
-/** @} */
-
-#endif /* CYGWINMSVC */
-
-/*===========================================================================*/
-/* Custom icu entry point renaming */
-/*===========================================================================*/
-
-/**
- * Define the library suffix with C syntax.
- * @internal
- */
-# define U_LIB_SUFFIX_C_NAME @ICULIBSUFFIXCNAME@
-/**
- * Define the library suffix as a string with C syntax
- * @internal
- */
-# define U_LIB_SUFFIX_C_NAME_STRING "@ICULIBSUFFIXCNAME@"
-/**
- * 1 if a custom library suffix is set
- * @internal
- */
-# define U_HAVE_LIB_SUFFIX @U_HAVE_LIB_SUFFIX@
-
-#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 ## _ ## @LIB_VERSION_MAJOR@ ## @ICULIBSUFFIXCNAME@
-# define U_DEF_ICUDATA_ENTRY_POINT(major) icudt##@ICULIBSUFFIXCNAME@##major##_dat
-
-# endif
-#endif
-
-#endif
+++ /dev/null
-/*
-******************************************************************************
-*
-* Copyright (C) 2011, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-******************************************************************************
-*
-* Note: Windows build with MSVC Solution/Project files creates platform.h from
-* platform.win buring common library build. This file is an empty header
-* file to ensure the #include "unicode/platform.h" statement works.
-* If ICU4C is built with Cywin using MSVC, the normal autoconf generated
-* platform.h file will be used instead of this empty header file. This
-* will help the user of ICU to know whether ICU was built with Cygwin using
-* MSVC or was built with just the MSVC Solution/Project files.
-*/
-
-#ifndef _PLATFORM_H
-#define _PLATFORM_H
-/*
- * This header file should be kept empty unless a Windows specific definition or
- * configuration is needed.
- */
-#endif
-
+++ /dev/null
-/*
-******************************************************************************
-*
-* Copyright (C) 1997-2011, International Business Machines
-* Corporation and others. All Rights Reserved.
-*
-******************************************************************************
-*
-* FILE NAME : ppalmos.h
-*
-* Date Name Description
-* 05/10/04 Ken Krugler Creation (copied from pwin32.h & modified).
-******************************************************************************
-*/
-
-#ifndef U_PPALMOS_H
-#define U_PPALMOS_H
-
- /**
- * \file
- * \brief Configuration constants for the Palm OS platform
- */
-
-/* Define the platform we're on. */
-#ifndef U_PALMOS
-#define U_PALMOS
-#endif
-
-/* _MSC_VER is used to detect the Microsoft compiler. */
-#if defined(_MSC_VER)
-#define U_INT64_IS_LONG_LONG 0
-#else
-#define U_INT64_IS_LONG_LONG 1
-#endif
-
-/* Define whether inttypes.h is available */
-#ifndef U_HAVE_INTTYPES_H
-#define U_HAVE_INTTYPES_H 1
-#endif
-
-/*
- * Define what support for C++ streams is available.
- * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available
- * (1997711 is the date the ISO/IEC C++ FDIS was published), and then
- * one should qualify streams using the std namespace in ICU header
- * files.
- * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is
- * available instead (198506 is the date when Stroustrup published
- * "An Extensible I/O Facility for C++" at the summer USENIX conference).
- * If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and
- * support for them will be silently suppressed in ICU.
- *
- */
-
-#ifndef U_IOSTREAM_SOURCE
-#define U_IOSTREAM_SOURCE 199711
-#endif
-
-/* Determines whether specific types are available */
-#ifndef U_HAVE_INT8_T
-#define U_HAVE_INT8_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_UINT8_T
-#define U_HAVE_UINT8_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_INT16_T
-#define U_HAVE_INT16_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_UINT16_T
-#define U_HAVE_UINT16_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_INT32_T
-#define U_HAVE_INT32_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_UINT32_T
-#define U_HAVE_UINT32_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_INT64_T
-#define U_HAVE_INT64_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_UINT64_T
-#define U_HAVE_UINT64_T U_HAVE_INTTYPES_H
-#endif
-
-
-/*===========================================================================*/
-/* Generic data types */
-/*===========================================================================*/
-
-/* If your platform does not have the <inttypes.h> header, you may
- need to edit the typedefs below. */
-#if U_HAVE_INTTYPES_H
-#include <inttypes.h>
-#else /* U_HAVE_INTTYPES_H */
-
-#if ! U_HAVE_INT8_T
-typedef signed char int8_t;
-#endif
-
-#if ! U_HAVE_UINT8_T
-typedef unsigned char uint8_t;
-#endif
-
-#if ! U_HAVE_INT16_T
-typedef signed short int16_t;
-#endif
-
-#if ! U_HAVE_UINT16_T
-typedef unsigned short uint16_t;
-#endif
-
-#if ! U_HAVE_INT32_T
-typedef signed int int32_t;
-#endif
-
-#if ! U_HAVE_UINT32_T
-typedef unsigned int uint32_t;
-#endif
-
-#if ! U_HAVE_INT64_T
-#if U_INT64_IS_LONG_LONG
- typedef signed long long int64_t;
-#else
- typedef signed __int64 int64_t;
-#endif
-#endif
-
-#if ! U_HAVE_UINT64_T
-#if U_INT64_IS_LONG_LONG
- typedef unsigned long long uint64_t;
-#else
- typedef unsigned __int64 uint64_t;
-#endif
-#endif
-#endif
-
-/*===========================================================================*/
-/* Compiler and environment features */
-/*===========================================================================*/
-
-/* Determines the endianness of the platform */
-#define U_IS_BIG_ENDIAN 0
-
-/* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
-#define ICU_USE_THREADS 1
-
-#ifndef U_DEBUG
-#ifdef _DEBUG
-#define U_DEBUG 1
-#else
-#define U_DEBUG 0
-#endif
-#endif
-
-#ifndef U_RELEASE
-#ifdef NDEBUG
-#define U_RELEASE 1
-#else
-#define U_RELEASE 0
-#endif
-#endif
-
-/* Determine whether to disable renaming or not. This overrides the
- setting in umachine.h which is for all platforms. */
-#ifndef U_DISABLE_RENAMING
-#define U_DISABLE_RENAMING 0
-#endif
-
-/* Determine whether to override new and delete. */
-#ifndef U_OVERRIDE_CXX_ALLOCATION
-#define U_OVERRIDE_CXX_ALLOCATION 1
-#endif
-/* Determine whether to override placement new and delete for STL. */
-#ifndef U_HAVE_PLACEMENT_NEW
-#define U_HAVE_PLACEMENT_NEW 0
-#endif
-/* Determine whether to override new and delete for MFC. */
-#if !defined(U_HAVE_DEBUG_LOCATION_NEW) && defined(_MSC_VER)
-#define U_HAVE_DEBUG_LOCATION_NEW 0
-#endif
-
-/* Determine whether to enable tracing. */
-#ifndef U_ENABLE_TRACING
-#define U_ENABLE_TRACING 1
-#endif
-
-/* Do we allow ICU users to use the draft APIs by default? */
-#ifndef U_DEFAULT_SHOW_DRAFT
-#define U_DEFAULT_SHOW_DRAFT 1
-#endif
-
-/* Define the library suffix in a C syntax. */
-#define U_HAVE_LIB_SUFFIX 0
-#define U_LIB_SUFFIX_C_NAME
-#define U_LIB_SUFFIX_C_NAME_STRING ""
-
-/*===========================================================================*/
-/* Information about wchar support */
-/*===========================================================================*/
-
-#define U_HAVE_WCHAR_H 1
-#define U_SIZEOF_WCHAR_T 2
-
-#define U_HAVE_WCSCPY 0
-
-/*===========================================================================*/
-/* Information about POSIX support */
-/*===========================================================================*/
-
-
-/* TODO: Fix Palm OS's determination of a timezone */
-#if 0
-#define U_TZSET _tzset
-#endif
-#if 0
-#define U_TIMEZONE _timezone
-#endif
-#if 0
-#define U_TZNAME _tzname
-#endif
-
-#define U_HAVE_MMAP 0
-#define U_HAVE_POPEN 0
-
-/*===========================================================================*/
-/* Symbol import-export control */
-/*===========================================================================*/
-
-#define U_EXPORT
-#define U_EXPORT2
-#define U_IMPORT
-
-/*===========================================================================*/
-/* Code alignment */
-/*===========================================================================*/
-
-#if defined(_MSC_VER) && defined(_M_IX86)
-#define U_ALIGN_CODE(val) __asm align val
-#else
-#define U_ALIGN_CODE(val)
-#endif
-
-
-/*===========================================================================*/
-/* Programs used by ICU code */
-/*===========================================================================*/
-
-#ifndef U_MAKE
-#define U_MAKE "nmake"
-#define U_MAKE_IS_NMAKE 1
-#endif
-
-#endif
/*
******************************************************************************
*
-* Copyright (C) 1997-2010, International Business Machines
+* Copyright (C) 1997-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
/* Generic data types */
/*===========================================================================*/
-/* If your platform does not have the <inttypes.h> header, you may
- need to edit the typedefs below. */
-#if U_HAVE_INTTYPES_H
+/* If your platform does not have the <stdint.h> header, you may
+ need to edit the typedefs in the #else section below.
+ Use #if...#else...#endif with predefined compiler macros if possible. */
+#if U_HAVE_STDINT_H
-/* autoconf 2.13 sometimes can't properly find the data types in <inttypes.h> */
-/* os/390 needs <inttypes.h>, but it doesn't have int8_t, and it sometimes */
-/* doesn't have uint8_t depending on the OS version. */
-/* So we have this work around. */
-#ifdef OS390
+/*
+ * We mostly need <stdint.h> (which defines the standard integer types) but not <inttypes.h>.
+ * <inttypes.h> includes <stdint.h> and adds the printf/scanf helpers PRId32, SCNx16 etc.
+ * which we almost never use, plus stuff like imaxabs() which we never use.
+ */
+#include <stdint.h>
+
+/* z/OS has <stdint.h>, but some versions are missing int8_t and/or uint8_t (APAR PK62248). */
+#if U_PLATFORM == U_PF_OS390
/* The features header is needed to get (u)int64_t sometimes. */
#include <features.h>
-#if ! U_HAVE_INT8_T
+#if !defined(__int8_t)
+#define __int8_t 1
typedef signed char int8_t;
#endif
#if !defined(__uint8_t)
#define __uint8_t 1
typedef unsigned char uint8_t;
#endif
-#endif /* OS390 */
+#endif /* U_PLATFORM == U_PF_OS390 */
+
+#elif U_HAVE_INTTYPES_H
-#include <inttypes.h>
+# include <inttypes.h>
-#else /* U_HAVE_INTTYPES_H */
+#else /* neither U_HAVE_STDINT_H nor U_HAVE_INTTYPES_H */
#if ! U_HAVE_INT8_T
typedef signed char int8_t;
#endif
#if ! U_HAVE_INT64_T
+#ifdef _MSC_VER
+ typedef signed __int64 int64_t;
+#else
typedef signed long long int64_t;
-/* else we may not have a 64-bit type */
+#endif
#endif
#if ! U_HAVE_UINT64_T
+#ifdef _MSC_VER
+ typedef unsigned __int64 uint64_t;
+#else
typedef unsigned long long uint64_t;
-/* else we may not have a 64-bit type */
+#endif
#endif
-#endif /* U_HAVE_INTTYPES_H */
+#endif /* U_HAVE_STDINT_H / U_HAVE_INTTYPES_H */
#endif /* _PTYPES_H */
-
/*
******************************************************************************
*
-* Copyright (C) 1997-2009, International Business Machines
+* Copyright (C) 1997-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
* Example: '/' and ':' on Unix, '\\' and ';' on Windows.
* @stable ICU 2.0
*/
-#ifdef XP_MAC
+#if U_PLATFORM == U_PF_CLASSIC_MACOS
# define U_FILE_SEP_CHAR ':'
# define U_FILE_ALT_SEP_CHAR ':'
# define U_PATH_SEP_CHAR ';'
# define U_FILE_SEP_STRING ":"
# define U_FILE_ALT_SEP_STRING ":"
# define U_PATH_SEP_STRING ";"
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_USES_ONLY_WIN32_API
# define U_FILE_SEP_CHAR '\\'
# define U_FILE_ALT_SEP_CHAR '/'
# define U_PATH_SEP_CHAR ';'
+++ /dev/null
-/*
- ******************************************************************************
- *
- * Copyright (C) 1997-2011, International Business Machines
- * Corporation and others. All Rights Reserved.
- *
- ******************************************************************************
- *
- * FILE NAME : platform.h
- *
- * Date Name Description
- * 05/13/98 nos Creation (content moved here from ptypes.h).
- * 03/02/99 stephen Added AS400 support.
- * 03/30/99 stephen Added Linux support.
- * 04/13/99 stephen Reworked for autoconf.
- ******************************************************************************
- */
-
- /**
- * \file
- * \brief Configuration constants for the Windows platform
- */
-
-/** Define the platform we're on. */
-#ifndef U_WINDOWS
-#define U_WINDOWS
-#endif
-
-#if defined(__BORLANDC__)
-#define U_HAVE_PLACEMENT_NEW 0
-#define __STDC_CONSTANT_MACROS
-#endif
-
-/** _MSC_VER is used to detect the Microsoft compiler. */
-#if defined(_MSC_VER)
-#define U_INT64_IS_LONG_LONG 0
-#else
-#define U_INT64_IS_LONG_LONG 1
-#endif
-
-/** Define whether inttypes.h is available */
-#ifndef U_HAVE_INTTYPES_H
-# if defined(__BORLANDC__)
-# define U_HAVE_INTTYPES_H 1
-# else
-# define U_HAVE_INTTYPES_H 0
-# endif
-#endif
-
-/**
- * Define what support for C++ streams is available.
- * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available
- * (1997711 is the date the ISO/IEC C++ FDIS was published), and then
- * one should qualify streams using the std namespace in ICU header
- * files.
- * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is
- * available instead (198506 is the date when Stroustrup published
- * "An Extensible I/O Facility for C++" at the summer USENIX conference).
- * If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and
- * support for them will be silently suppressed in ICU.
- *
- */
-
-#ifndef U_IOSTREAM_SOURCE
-#define U_IOSTREAM_SOURCE 199711
-#endif
-
-/** @{
- * Determines whether specific types are available */
-#ifndef U_HAVE_INT8_T
-#define U_HAVE_INT8_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_UINT8_T
-#define U_HAVE_UINT8_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_INT16_T
-#define U_HAVE_INT16_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_UINT16_T
-#define U_HAVE_UINT16_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_INT32_T
-#define U_HAVE_INT32_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_UINT32_T
-#define U_HAVE_UINT32_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_INT64_T
-#define U_HAVE_INT64_T U_HAVE_INTTYPES_H
-#endif
-
-#ifndef U_HAVE_UINT64_T
-#define U_HAVE_UINT64_T U_HAVE_INTTYPES_H
-#endif
-
-/** @} */
-
-/** Define 64 bit limits */
-#if !U_INT64_IS_LONG_LONG
-# ifndef INT64_C
-# define INT64_C(x) ((int64_t)x)
-# endif
-# ifndef UINT64_C
-# define UINT64_C(x) ((uint64_t)x)
-# endif
-/** else use the umachine.h definition */
-#endif
-
-/*===========================================================================*/
-/** @{
- * Generic data types */
-/*===========================================================================*/
-
-/** If your platform does not have the <inttypes.h> header, you may
- need to edit the typedefs below. */
-#if U_HAVE_INTTYPES_H
-#include <inttypes.h>
-#else /* U_HAVE_INTTYPES_H */
-
-#if ! U_HAVE_INT8_T
-typedef signed char int8_t;
-#endif
-
-#if ! U_HAVE_UINT8_T
-typedef unsigned char uint8_t;
-#endif
-
-#if ! U_HAVE_INT16_T
-typedef signed short int16_t;
-#endif
-
-#if ! U_HAVE_UINT16_T
-typedef unsigned short uint16_t;
-#endif
-
-#if ! U_HAVE_INT32_T
-typedef signed int int32_t;
-#endif
-
-#if ! U_HAVE_UINT32_T
-typedef unsigned int uint32_t;
-#endif
-
-#if ! U_HAVE_INT64_T
-#if U_INT64_IS_LONG_LONG
- typedef signed long long int64_t;
-#else
- typedef signed __int64 int64_t;
-#endif
-#endif
-
-#if ! U_HAVE_UINT64_T
-#if U_INT64_IS_LONG_LONG
- typedef unsigned long long uint64_t;
-#else
- typedef unsigned __int64 uint64_t;
-#endif
-#endif
-#endif
-
-/**
- * @}
- */
-
-/*===========================================================================*/
-/** Compiler and environment features */
-/*===========================================================================*/
-
-/** Determines the endianness of the platform */
-#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
-
-/** 0 or 1 to enable or disable auto cleanup of libraries. If undefined, default is: disabled. */
-#ifndef UCLN_NO_AUTO_CLEANUP
-#define UCLN_NO_AUTO_CLEANUP 1
-#endif
-
-/** Enable or disable debugging options **/
-#ifndef U_DEBUG
-#ifdef _DEBUG
-#define U_DEBUG 1
-#else
-#define U_DEBUG 0
-#endif
-#endif
-
-/** Enable or disable release options **/
-#ifndef U_RELEASE
-#ifdef NDEBUG
-#define U_RELEASE 1
-#else
-#define U_RELEASE 0
-#endif
-#endif
-
-/** Determine whether to disable renaming or not. This overrides the
- setting in umachine.h which is for all platforms. */
-#ifndef U_DISABLE_RENAMING
-#define U_DISABLE_RENAMING 0
-#endif
-
-/** Determine whether to override new and delete. */
-#ifndef U_OVERRIDE_CXX_ALLOCATION
-#define U_OVERRIDE_CXX_ALLOCATION 1
-#endif
-/** Determine whether to override placement new and delete for STL. */
-#ifndef U_HAVE_PLACEMENT_NEW
-#define U_HAVE_PLACEMENT_NEW 1
-#endif
-/** Determine whether to override new and delete for MFC. */
-#if !defined(U_HAVE_DEBUG_LOCATION_NEW) && defined(_MSC_VER)
-#define U_HAVE_DEBUG_LOCATION_NEW 1
-#endif
-
-/** Determine whether to enable tracing. */
-#ifndef U_ENABLE_TRACING
-#define U_ENABLE_TRACING 0
-#endif
-
-/** Do we allow ICU users to use the draft APIs by default? */
-#ifndef U_DEFAULT_SHOW_DRAFT
-#define U_DEFAULT_SHOW_DRAFT 1
-#endif
-
-/** @{ Define the library suffix in a C syntax. */
-#ifndef U_HAVE_LIB_SUFFIX
-#define U_HAVE_LIB_SUFFIX 0
-#endif
-#ifndef U_LIB_SUFFIX_C_NAME
-#define U_LIB_SUFFIX_C_NAME
-#endif
-#ifndef U_LIB_SUFFIX_C_NAME_STRING
-#define U_LIB_SUFFIX_C_NAME_STRING ""
-#endif
-/** @} */
-
-/*===========================================================================*/
-/** @{ Information about wchar support */
-/*===========================================================================*/
-
-#define U_HAVE_WCHAR_H 1
-#define U_SIZEOF_WCHAR_T 2
-
-#define U_HAVE_WCSCPY 1
-
-/** @} */
-
-/**
- * \def U_DECLARE_UTF16
- * Do not use this macro. Use the UNICODE_STRING or U_STRING_DECL macros
- * instead.
- * @internal
- */
-#if 1
-#define U_DECLARE_UTF16(string) L ## string
-#endif
-
-/*===========================================================================*/
-/** @{ Information about POSIX support */
-/*===========================================================================*/
-
-/**
- * @internal
- */
-#if 1
-#define U_TZSET _tzset
-#endif
-/**
- * @internal
- */
-#if 1
-#define U_TIMEZONE _timezone
-#endif
-/**
- * @internal
- */
-#if 1
-#define U_TZNAME _tzname
-#endif
-/**
- * @internal
- */
-#if 1
-#define U_DAYLIGHT _daylight
-#endif
-
-#define U_HAVE_MMAP 0
-#define U_HAVE_POPEN 0
-
-#ifndef U_ENABLE_DYLOAD
-#define U_ENABLE_DYLOAD 1
-#endif
-
-
-/** @} */
-
-/*===========================================================================*/
-/** @{ Symbol import-export control */
-/*===========================================================================*/
-
-#ifdef U_STATIC_IMPLEMENTATION
-#define U_EXPORT
-#else
-#define U_EXPORT __declspec(dllexport)
-#endif
-#define U_EXPORT2 __cdecl
-#define U_IMPORT __declspec(dllimport)
-/** @} */
-
-/*===========================================================================*/
-/** @{ Code alignment */
-/*===========================================================================*/
-
-#if defined(_MSC_VER) && defined(_M_IX86) && !defined(_MANAGED)
-#define U_ALIGN_CODE(val) __asm align val
-#else
-#define U_ALIGN_CODE(val)
-#endif
-
-/**
- * Flag for workaround of MSVC 2003 optimization bugs
- */
-#if defined(_MSC_VER) && (_MSC_VER < 1400)
-#define U_HAVE_MSVC_2003_OR_EARLIER
-#endif
-
-
-/** @} */
-
-/*===========================================================================*/
-/** @{ Programs used by ICU code */
-/*===========================================================================*/
-
-#ifndef U_MAKE
-#define U_MAKE "nmake"
-#define U_MAKE_IS_NMAKE 1
-#endif
-
-/** @} */
-
#include "unicode/utypes.h"
-/**
- * \def U_HAVE_STD_STRING
- * Define whether the standard C++ (STL) <string> header is available.
- * @internal
- */
-#ifndef U_HAVE_STD_STRING
-#define U_HAVE_STD_STRING 1
-#endif
-
#if U_HAVE_STD_STRING
#include <string>
/*!
* \file
- * \brief Switches for excluding parts of ICU library code modules.
+ * \brief User-configurable settings
*
- * Allows to build partial, smaller libraries for special purposes.
+ * Miscellaneous switches:
+ *
+ * A number of macros affect a variety of minor aspects of ICU.
+ * Most of them used to be defined elsewhere (e.g., in utypes.h or platform.h)
+ * and moved here to make them easier to find.
+ *
+ * Switches for excluding parts of ICU library code modules:
+ *
+ * Changing these macros allows building partial, smaller libraries for special purposes.
* By default, all modules are built.
* The switches are fairly coarse, controlling large modules.
* Basic services cannot be turned off.
/**
* If this switch is defined, ICU will attempt to load a header file named "uconfig_local.h"
* prior to determining default settings for uconfig variables.
- *
+ *
* @internal ICU 4.0
- *
*/
#if defined(UCONFIG_USE_LOCAL)
#include "uconfig_local.h"
#endif
+/**
+ * \def U_DEBUG
+ * Determines whether to include debugging code.
+ * Automatically set on Windows, but most compilers do not have
+ * related predefined macros.
+ * @internal
+ */
+#ifdef U_DEBUG
+ /* Use the predefined value. */
+#elif defined(_DEBUG)
+ /*
+ * _DEBUG is defined by Visual Studio debug compilation.
+ * Do *not* test for its NDEBUG macro: It is an orthogonal macro
+ * which disables assert().
+ */
+# define U_DEBUG 1
+#elif defined(U_RELEASE)
+# define U_DEBUG (!U_RELEASE)
+# else
+# define U_DEBUG 0
+#endif
+
+/**
+ * \def U_DEBUG
+ * Opposite of U_DEBUG.
+ * @internal
+ */
+#ifndef U_RELEASE
+#define U_RELEASE (!U_DEBUG)
+#endif
+
+/**
+ * Determines wheter to enable auto cleanup of libraries.
+ * @internal
+ */
+#ifndef UCLN_NO_AUTO_CLEANUP
+#define UCLN_NO_AUTO_CLEANUP 1
+#endif
+
+/**
+ * \def ICU_USE_THREADS
+ *
+ * Allows thread support (use of mutexes) to be compiled out of ICU.
+ * Default: use threads.
+ *
+ * Even with thread support compiled out, applications may override the
+ * (empty) mutex implementation with the u_setMutexFunctions() functions.
+ * @internal
+ */
+#ifdef ICU_USE_THREADS
+ /* Use the predefined value. */
+#elif defined(APP_NO_THREADS)
+ /* APP_NO_THREADS is an old symbol. We'll honour it if present. */
+# define ICU_USE_THREADS 0
+#else
+# define ICU_USE_THREADS 1
+#endif
+
+/**
+ * \def U_DISABLE_RENAMING
+ * Determines whether to disable renaming or not.
+ * @internal
+ */
+#ifndef U_DISABLE_RENAMING
+#define U_DISABLE_RENAMING 0
+#endif
+
+/**
+ * \def U_OVERRIDE_CXX_ALLOCATION
+ * Determines whether to override new and delete.
+ * ICU is normally built such that all of its C++ classes, via their UMemory base,
+ * override operators new and delete to use its internal, customizable,
+ * non-exception-throwing memory allocation functions. (Default value 1 for this macro.)
+ *
+ * This is especially important when the application and its libraries use multiple heaps.
+ * For example, on Windows, this allows the ICU DLL to be used by
+ * applications that statically link the C Runtime library.
+ *
+ * @stable ICU 2.2
+ */
+#ifndef U_OVERRIDE_CXX_ALLOCATION
+#define U_OVERRIDE_CXX_ALLOCATION 1
+#endif
+
+/**
+ * \def U_ENABLE_TRACING
+ * Determines whether to enable tracing.
+ * @internal
+ */
+#ifndef U_ENABLE_TRACING
+#define U_ENABLE_TRACING 0
+#endif
+
+/**
+ * \def U_ENABLE_DYLOAD
+ * Whether to enable Dynamic loading in ICU.
+ * @internal
+ */
+#ifndef U_ENABLE_DYLOAD
+#define U_ENABLE_DYLOAD 1
+#endif
+
+/**
+ * \def U_CHECK_DYLOAD
+ * Whether to test Dynamic loading as an OS capability.
+ * @internal
+ */
+#ifndef U_CHECK_DYLOAD
+#define U_CHECK_DYLOAD 1
+#endif
+
+
+/**
+ * \def U_DEFAULT_SHOW_DRAFT
+ * Do we allow ICU users to use the draft APIs by default?
+ * @internal
+ */
+#ifndef U_DEFAULT_SHOW_DRAFT
+#define U_DEFAULT_SHOW_DRAFT 1
+#endif
+
+/*===========================================================================*/
+/* Custom icu entry point renaming */
+/*===========================================================================*/
+
+/**
+ * \def U_HAVE_LIB_SUFFIX
+ * 1 if a custom library suffix is set.
+ * @internal
+ */
+#ifdef U_HAVE_LIB_SUFFIX
+ /* Use the predefined value. */
+#elif defined(U_LIB_SUFFIX_C_NAME) || defined(U_LIB_SUFFIX_C_NAME_STRING)
+# define U_HAVE_LIB_SUFFIX 1
+#else
+# define U_HAVE_LIB_SUFFIX 0
+#endif
+
+/**
+ * \def U_LIB_SUFFIX_C_NAME_STRING
+ * Defines the library suffix as a string with C syntax.
+ * @internal
+ */
+#ifdef U_LIB_SUFFIX_C_NAME_STRING
+ /* Use the predefined value. */
+#elif defined(U_LIB_SUFFIX_C_NAME)
+# define U_LIB_SUFFIX_C_NAME_STRING #U_LIB_SUFFIX_C_NAME
+#else
+# define U_LIB_SUFFIX_C_NAME_STRING ""
+#endif
+
+/**
+ * \def U_LIB_SUFFIX_C_NAME
+ * Defines the library suffix with C syntax.
+ * @internal
+ */
+#ifdef U_LIB_SUFFIX_C_NAME
+ /* Use the predefined value. */
+#else
+# define U_LIB_SUFFIX_C_NAME
+#endif
+
+/* common/i18n library switches --------------------------------------------- */
+
/**
* \def UCONFIG_ONLY_COLLATION
* This switch turns off modules that are not needed for collation.
/* which are contained in the platform-specific file platform.h */
/*==========================================================================*/
-#if defined(U_PALMOS)
-# include "unicode/ppalmos.h"
-#elif !defined(__MINGW32__) && (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64))
-/*
- * platform.h is now also generated by MSVC Solution/Project files
- * from platform.win and should always be included unless you are
- * building stubdata which is built before the platform.h file is
- * generated.
- */
-#ifndef STUBDATA_BUILD
-# include "unicode/platform.h"
-#endif
-# include "unicode/pwin32.h"
-#else
-# include "unicode/ptypes.h" /* platform.h is included in ptypes.h */
-#endif
+#include "unicode/ptypes.h" /* platform.h is included in ptypes.h */
/*
* ANSI C headers:
*/
#include <stddef.h>
-/*==========================================================================*/
-/* XP_CPLUSPLUS is a cross-platform symbol which should be defined when */
-/* using C++. It should not be defined when compiling under C. */
-/*==========================================================================*/
-
-#ifdef __cplusplus
-# ifndef XP_CPLUSPLUS
-# define XP_CPLUSPLUS
-# endif
-#else
-# undef XP_CPLUSPLUS
-#endif
-
/*==========================================================================*/
/* For C wrappers, we use the symbol U_STABLE. */
/* This works properly if the includer is C or C++. */
* @stable ICU 2.4
*/
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
# define U_CFUNC extern "C"
# define U_CDECL_BEGIN extern "C" {
# define U_CDECL_END }
* This is used for Visual C++ specific attributes
* @internal
*/
-#elif defined(U_WINDOWS) && defined(_MSC_VER) && (_MSC_VER >= 1400)
+#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
# define U_ATTRIBUTE_DEPRECATED __declspec(deprecated)
#else
# define U_ATTRIBUTE_DEPRECATED
/* wchar_t-related definitions -------------------------------------------- */
-/**
- * \def U_HAVE_WCHAR_H
- * Indicates whether <wchar.h> is available (1) or not (0). Set to 1 by default.
- *
- * @stable ICU 2.0
- */
-#ifndef U_HAVE_WCHAR_H
-# define U_HAVE_WCHAR_H 1
-#endif
-
-/**
- * \def U_SIZEOF_WCHAR_T
- * U_SIZEOF_WCHAR_T==sizeof(wchar_t) (0 means it is not defined or autoconf could not set it)
- *
- * @stable ICU 2.0
- */
-#if U_SIZEOF_WCHAR_T==0
-# undef U_SIZEOF_WCHAR_T
-# define U_SIZEOF_WCHAR_T 4
-#endif
-
/*
* \def U_WCHAR_IS_UTF16
* Defined if wchar_t uses UTF-16.
# define U_WCHAR_IS_UTF32
# endif
# elif defined __UCS2__
-# if (__OS390__ || __OS400__) && (U_SIZEOF_WCHAR_T==2)
+# if (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400) && (U_SIZEOF_WCHAR_T==2)
# define U_WCHAR_IS_UTF16
# endif
-# elif defined __UCS4__
+# elif defined(__UCS4__) || (U_PLATFORM == U_PF_OS400 && defined(__UTF32__))
# if (U_SIZEOF_WCHAR_T==4)
# define U_WCHAR_IS_UTF32
# endif
-# elif defined(U_WINDOWS)
+# elif U_PLATFORM_IS_DARWIN_BASED || (U_SIZEOF_WCHAR_T==4 && U_PLATFORM_IS_LINUX_BASED)
+# define U_WCHAR_IS_UTF32
+# elif U_PLATFORM_HAS_WIN32_API
# define U_WCHAR_IS_UTF16
# endif
#endif
/**
* \var UChar
- * Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned.
- * If wchar_t is not 16 bits wide, then define UChar to be uint16_t or char16_t because GCC >=4.4
- * can handle UTF16 string literals.
+ * Define UChar to be char16_t, if available,
+ * or wchar_t if that is 16 bits wide; always assumed to be unsigned.
+ * If neither is available, then define UChar to be uint16_t.
+ *
* This makes the definition of UChar platform-dependent
* but allows direct string type compatibility with platforms with
* 16-bit wchar_t types.
* @draft ICU 4.4
*/
-/* Define UChar to be compatible with wchar_t if possible. */
-#if U_SIZEOF_WCHAR_T==2
- typedef wchar_t UChar;
-#elif U_GNUC_UTF16_STRING
-#if defined _GCC_
- typedef __CHAR16_TYPE__ char16_t;
-#endif
+/* Define UChar to be compatible with char16_t or wchar_t if possible. */
+#if U_HAVE_CHAR16_T
typedef char16_t UChar;
+#elif U_SIZEOF_WCHAR_T==2
+ typedef wchar_t UChar;
+#elif defined(__CHAR16_TYPE__)
+ typedef __CHAR16_TYPE__ UChar;
#else
typedef uint16_t UChar;
#endif
*/
typedef int32_t UChar32;
-/*==========================================================================*/
-/* U_ALIGN_CODE Set default values if these are not already */
-/* defined. Definitions normally are in */
-/* platform.h or the corresponding file for */
-/* the OS in use. */
-/*==========================================================================*/
-
-#ifndef U_HIDE_INTERNAL_API
-
-/**
- * \def U_ALIGN_CODE
- * This is used to align code fragments to a specific byte boundary.
- * This is useful for getting consistent performance test results.
- * @internal
- */
-#ifndef U_ALIGN_CODE
-# define U_ALIGN_CODE(n)
-#endif
-
-#endif /* U_HIDE_INTERNAL_API */
-
#include "unicode/urename.h"
#endif
/*
******************************************************************************
*
-* Copyright (C) 2002-2010, International Business Machines
+* Copyright (C) 2002-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
#include "unicode/utypes.h"
-U_NAMESPACE_BEGIN
-
/**
* \file
* \brief C++ API: Common ICU base class UObject.
*/
-/** U_OVERRIDE_CXX_ALLOCATION - Define this to override operator new and
- * delete in UMemory. Enabled by default for ICU.
- *
- * Enabling forces all allocation of ICU object types to use ICU's
- * memory allocation. On Windows, this allows the ICU DLL to be used by
- * applications that statically link the C Runtime library, meaning that
- * the app and ICU will be using different heaps.
- *
- * @stable ICU 2.2
- */
-#ifndef U_OVERRIDE_CXX_ALLOCATION
-#define U_OVERRIDE_CXX_ALLOCATION 1
-#endif
-
-/**
- * \def U_HAVE_PLACEMENT_NEW
- * Define this to define the placement new and
- * delete in UMemory for STL.
- *
- * @stable ICU 2.6
- */
-#ifndef U_HAVE_PLACEMENT_NEW
-#define U_HAVE_PLACEMENT_NEW 1
-#endif
-
-
-/**
- * \def U_HAVE_DEBUG_LOCATION_NEW
- * Define this to define the MFC debug
- * version of the operator new.
- *
- * @stable ICU 3.4
- */
-#ifndef U_HAVE_DEBUG_LOCATION_NEW
-#define U_HAVE_DEBUG_LOCATION_NEW 0
-#endif
-
/**
* @{
* \def U_NO_THROW
* data, (which it typically does), the result is a segmentation violation.
*
* @draft ICU 4.2
- */
+ */
#ifndef U_NO_THROW
#define U_NO_THROW throw()
#endif
/** @} */
+/*===========================================================================*/
+/* UClassID-based RTTI */
+/*===========================================================================*/
+
+/**
+ * UClassID is used to identify classes without using the compiler's RTTI.
+ * This was used before C++ compilers consistently supported RTTI.
+ * ICU 4.6 requires compiler RTTI to be turned on.
+ *
+ * Each class hierarchy which needs
+ * to implement polymorphic clone() or operator==() defines two methods,
+ * described in detail below. UClassID values can be compared using
+ * operator==(). Nothing else should be done with them.
+ *
+ * \par
+ * getDynamicClassID() is declared in the base class of the hierarchy as
+ * a pure virtual. Each concrete subclass implements it in the same way:
+ *
+ * \code
+ * class Base {
+ * public:
+ * virtual UClassID getDynamicClassID() const = 0;
+ * }
+ *
+ * class Derived {
+ * public:
+ * virtual UClassID getDynamicClassID() const
+ * { return Derived::getStaticClassID(); }
+ * }
+ * \endcode
+ *
+ * Each concrete class implements getStaticClassID() as well, which allows
+ * clients to test for a specific type.
+ *
+ * \code
+ * class Derived {
+ * public:
+ * static UClassID U_EXPORT2 getStaticClassID();
+ * private:
+ * static char fgClassID;
+ * }
+ *
+ * // In Derived.cpp:
+ * UClassID Derived::getStaticClassID()
+ * { return (UClassID)&Derived::fgClassID; }
+ * char Derived::fgClassID = 0; // Value is irrelevant
+ * \endcode
+ * @stable ICU 2.0
+ */
+typedef void* UClassID;
+
+U_NAMESPACE_BEGIN
+
/**
* UMemory is the common ICU base class.
* All other ICU C++ classes are derived from UMemory (starting with ICU 2.4).
* \def U_SHOW_CPLUSPLUS_API
* @internal
*/
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
# ifndef U_SHOW_CPLUSPLUS_API
# define U_SHOW_CPLUSPLUS_API 1
# endif
/** @} */
-
-/*===========================================================================*/
-/* char Character set family */
-/*===========================================================================*/
-
-/**
- * U_CHARSET_FAMILY is equal to this value when the platform is an ASCII based platform.
- * @stable ICU 2.0
- */
-#define U_ASCII_FAMILY 0
-
-/**
- * U_CHARSET_FAMILY is equal to this value when the platform is an EBCDIC based platform.
- * @stable ICU 2.0
- */
-#define U_EBCDIC_FAMILY 1
-
-/**
- * \def U_CHARSET_FAMILY
- *
- * <p>These definitions allow to specify the encoding of text
- * in the char data type as defined by the platform and the compiler.
- * It is enough to determine the code point values of "invariant characters",
- * which are the ones shared by all encodings that are in use
- * on a given platform.</p>
- *
- * <p>Those "invariant characters" should be all the uppercase and lowercase
- * latin letters, the digits, the space, and "basic punctuation".
- * Also, '\\n', '\\r', '\\t' should be available.</p>
- *
- * <p>The list of "invariant characters" is:<br>
- * \code
- * A-Z a-z 0-9 SPACE " % & ' ( ) * + , - . / : ; < = > ? _
- * \endcode
- * <br>
- * (52 letters + 10 numbers + 20 punc/sym/space = 82 total)</p>
- *
- * <p>This matches the IBM Syntactic Character Set (CS 640).</p>
- *
- * <p>In other words, all the graphic characters in 7-bit ASCII should
- * be safely accessible except the following:</p>
- *
- * \code
- * '\' <backslash>
- * '[' <left bracket>
- * ']' <right bracket>
- * '{' <left brace>
- * '}' <right brace>
- * '^' <circumflex>
- * '~' <tilde>
- * '!' <exclamation mark>
- * '#' <number sign>
- * '|' <vertical line>
- * '$' <dollar sign>
- * '@' <commercial at>
- * '`' <grave accent>
- * \endcode
- * @stable ICU 2.0
- */
-
-#ifndef U_CHARSET_FAMILY
-# define U_CHARSET_FAMILY 0
-#endif
-
-/**
- * \def U_CHARSET_IS_UTF8
- *
- * Hardcode the default charset to UTF-8.
- *
- * If this is set to 1, then
- * - ICU will assume that all non-invariant char*, StringPiece, std::string etc.
- * contain UTF-8 text, regardless of what the system API uses
- * - some ICU code will use fast functions like u_strFromUTF8()
- * rather than the more general and more heavy-weight conversion API (ucnv.h)
- * - ucnv_getDefaultName() always returns "UTF-8"
- * - ucnv_setDefaultName() is disabled and will not change the default charset
- * - static builds of ICU are smaller
- * - more functionality is available with the UCONFIG_NO_CONVERSION build-time
- * configuration option (see unicode/uconfig.h)
- * - the UCONFIG_NO_CONVERSION build option in uconfig.h is more usable
- *
- * @stable ICU 4.2
- * @see UCONFIG_NO_CONVERSION
- */
-#ifndef U_CHARSET_IS_UTF8
-# define U_CHARSET_IS_UTF8 0
-#endif
-
/*===========================================================================*/
/* ICUDATA naming scheme */
/*===========================================================================*/
#define U_DEF_ICUDATA_ENTRY_POINT(major) icudt##major##_dat
#endif
-/**
- * \def U_CALLCONV
- * Similar to U_CDECL_BEGIN/U_CDECL_END, this qualifier is necessary
- * in callback function typedefs to make sure that the calling convention
- * is compatible.
- *
- * This is only used for non-ICU-API functions.
- * When a function is a public ICU API,
- * you must use the U_CAPI and U_EXPORT2 qualifiers.
- * @stable ICU 2.0
- */
-#if defined(OS390) && defined(XP_CPLUSPLUS)
-# define U_CALLCONV __cdecl
-#else
-# define U_CALLCONV U_EXPORT2
-#endif
-
/**
* \def NULL
* Define NULL if necessary, to 0 for C++ and to ((void *)0) for C.
* @stable ICU 2.0
*/
#ifndef NULL
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
*/
#define U_DATE_MIN -U_DATE_MAX
-
-
-/*===========================================================================*/
-/* UClassID-based RTTI */
-/*===========================================================================*/
-
-/**
- * UClassID is used to identify classes without using RTTI, since RTTI
- * is not yet supported by all C++ compilers. Each class hierarchy which needs
- * to implement polymorphic clone() or operator==() defines two methods,
- * described in detail below. UClassID values can be compared using
- * operator==(). Nothing else should be done with them.
- *
- * \par
- * getDynamicClassID() is declared in the base class of the hierarchy as
- * a pure virtual. Each concrete subclass implements it in the same way:
- *
- * \code
- * class Base {
- * public:
- * virtual UClassID getDynamicClassID() const = 0;
- * }
- *
- * class Derived {
- * public:
- * virtual UClassID getDynamicClassID() const
- * { return Derived::getStaticClassID(); }
- * }
- * \endcode
- *
- * Each concrete class implements getStaticClassID() as well, which allows
- * clients to test for a specific type.
- *
- * \code
- * class Derived {
- * public:
- * static UClassID U_EXPORT2 getStaticClassID();
- * private:
- * static char fgClassID;
- * }
- *
- * // In Derived.cpp:
- * UClassID Derived::getStaticClassID()
- * { return (UClassID)&Derived::fgClassID; }
- * char Derived::fgClassID = 0; // Value is irrelevant
- * \endcode
- * @stable ICU 2.0
- */
-typedef void* UClassID;
-
/*===========================================================================*/
/* Shared library/DLL import-export API control */
/*===========================================================================*/
*
* Note: This is currently only done on Windows because
* some Linux/Unix compilers have problems with defining global new/delete.
- * On Windows, U_WINDOWS is defined, and it is _MSC_VER>=1200 for MSVC 6.0 and higher.
+ * On Windows, it is _MSC_VER>=1200 for MSVC 6.0 and higher.
*/
-#if defined(XP_CPLUSPLUS) && defined(U_WINDOWS) && U_DEBUG && U_OVERRIDE_CXX_ALLOCATION && (_MSC_VER>=1200) && !defined(U_STATIC_IMPLEMENTATION) && (defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION))
+#if defined(__cplusplus) && U_DEBUG && U_OVERRIDE_CXX_ALLOCATION && (_MSC_VER>=1200) && !defined(U_STATIC_IMPLEMENTATION) && (defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION))
#ifndef U_HIDE_INTERNAL_API
/**
/* Use the following to determine if an UErrorCode represents */
/* operational success or failure. */
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
/**
* Does the error code indicate success?
* @stable ICU 2.0
*/
/* Define namespace symbols if the compiler supports it. */
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
# if U_DISABLE_RENAMING
# define U_ICU_NAMESPACE icu
namespace U_ICU_NAMESPACE { }
const void *inData, int32_t length, void *outData,
UErrorCode *pErrorCode);
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
U_NAMESPACE_BEGIN
/*
******************************************************************************
*
-* Copyright (C) 2001-2010, International Business Machines
+* Copyright (C) 2001-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
/* C++ convenience wrappers ------------------------------------------------- */
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
#include "mutex.h"
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#include "wintz.h"
return icuid;
}
-#endif /* #ifdef U_WINDOWS */
+#endif /* U_PLATFORM_HAS_WIN32_API */
/*
********************************************************************************
-* Copyright (C) 2005-2008, International Business Machines
+* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
/**
* \file
U_CFUNC const char* U_EXPORT2
uprv_detectWindowsTimeZone();
-#endif /* #ifdef U_WINDOWS */
+#endif /* U_PLATFORM_HAS_WIN32_API */
#endif /* __WINTZ */
fi
# output the Makefiles
-ac_config_files="$ac_config_files icudefs.mk Makefile data/pkgdataMakefile config/Makefile.inc config/icu.pc config/pkgdataMakefile data/Makefile stubdata/Makefile common/Makefile i18n/Makefile layout/Makefile layoutex/Makefile io/Makefile extra/Makefile extra/uconv/Makefile extra/uconv/pkgdataMakefile extra/scrptrun/Makefile tools/Makefile tools/ctestfw/Makefile tools/toolutil/Makefile tools/makeconv/Makefile tools/genrb/Makefile tools/genccode/Makefile tools/gencmn/Makefile tools/gencnval/Makefile tools/genctd/Makefile tools/gentest/Makefile tools/gennorm2/Makefile tools/genbrk/Makefile tools/gensprep/Makefile tools/icuinfo/Makefile tools/icupkg/Makefile tools/icuswap/Makefile tools/pkgdata/Makefile tools/tzcode/Makefile tools/gencfu/Makefile test/Makefile test/compat/Makefile test/testdata/Makefile test/testdata/pkgdataMakefile test/hdrtst/Makefile test/intltest/Makefile test/cintltst/Makefile test/iotest/Makefile test/letest/Makefile test/perf/Makefile test/perf/collationperf/Makefile test/perf/dicttrieperf/Makefile test/perf/ubrkperf/Makefile test/perf/charperf/Makefile test/perf/convperf/Makefile test/perf/normperf/Makefile test/perf/DateFmtPerf/Makefile test/perf/strsrchperf/Makefile test/perf/unisetperf/Makefile test/perf/usetperf/Makefile test/perf/ustrperf/Makefile test/perf/utfperf/Makefile test/perf/utrie2perf/Makefile samples/Makefile samples/date/Makefile samples/cal/Makefile samples/layout/Makefile common/unicode/platform.h"
+ac_config_files="$ac_config_files icudefs.mk Makefile data/pkgdataMakefile config/Makefile.inc config/icu.pc config/pkgdataMakefile data/Makefile stubdata/Makefile common/Makefile i18n/Makefile layout/Makefile layoutex/Makefile io/Makefile extra/Makefile extra/uconv/Makefile extra/uconv/pkgdataMakefile extra/scrptrun/Makefile tools/Makefile tools/ctestfw/Makefile tools/toolutil/Makefile tools/makeconv/Makefile tools/genrb/Makefile tools/genccode/Makefile tools/gencmn/Makefile tools/gencnval/Makefile tools/genctd/Makefile tools/gentest/Makefile tools/gennorm2/Makefile tools/genbrk/Makefile tools/gensprep/Makefile tools/icuinfo/Makefile tools/icupkg/Makefile tools/icuswap/Makefile tools/pkgdata/Makefile tools/tzcode/Makefile tools/gencfu/Makefile test/Makefile test/compat/Makefile test/testdata/Makefile test/testdata/pkgdataMakefile test/hdrtst/Makefile test/intltest/Makefile test/cintltst/Makefile test/iotest/Makefile test/letest/Makefile test/perf/Makefile test/perf/collationperf/Makefile test/perf/dicttrieperf/Makefile test/perf/ubrkperf/Makefile test/perf/charperf/Makefile test/perf/convperf/Makefile test/perf/normperf/Makefile test/perf/DateFmtPerf/Makefile test/perf/strsrchperf/Makefile test/perf/unisetperf/Makefile test/perf/usetperf/Makefile test/perf/ustrperf/Makefile test/perf/utfperf/Makefile test/perf/utrie2perf/Makefile samples/Makefile samples/date/Makefile samples/cal/Makefile samples/layout/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
"samples/date/Makefile") CONFIG_FILES="$CONFIG_FILES samples/date/Makefile" ;;
"samples/cal/Makefile") CONFIG_FILES="$CONFIG_FILES samples/cal/Makefile" ;;
"samples/layout/Makefile") CONFIG_FILES="$CONFIG_FILES samples/layout/Makefile" ;;
- "common/unicode/platform.h") CONFIG_FILES="$CONFIG_FILES common/unicode/platform.h" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
test/perf/utfperf/Makefile \
test/perf/utrie2perf/Makefile \
samples/Makefile samples/date/Makefile \
- samples/cal/Makefile samples/layout/Makefile \
- common/unicode/platform.h])
+ samples/cal/Makefile samples/layout/Makefile])
AC_OUTPUT
echo
## Makefile.in for ICU - extra/scrptrun
-## Copyright (c) 2001, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
TARGET = srtest
DEFS = @DEFS@
-CPPFLAGS = @CPPFLAGS@ -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)
+CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/common -I$(top_srcdir)
CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
ENABLE_RPATH = @ENABLE_RPATH@
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
ifeq ($(PKGDATA_OPTS),)
U_NAMESPACE_USE
-#if (defined(U_WINDOWS) || defined(U_CYGWIN) || defined(U_MINGW)) && !defined(__STRICT_ANSI__)
+#if U_PLATFORM_USES_ONLY_WIN32_API && !defined(__STRICT_ANSI__)
#include <io.h>
#include <fcntl.h>
-#if defined(U_WINDOWS)
+#if U_PLATFORM_USES_ONLY_WIN32_API
#define USE_FILENO_BINARY_MODE 1
/* Windows likes to rename Unix-like functions */
#ifndef fileno
// Get and prettify pname.
pname = uprv_strrchr(*argv, U_FILE_SEP_CHAR);
-#ifdef U_WINDOWS
+#if U_PLATFORM_USES_ONLY_WIN32_API
if (!pname) {
pname = uprv_strrchr(*argv, '/');
}
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/common $(LIBCPPFLAGS) $(CPPFLAGSICUI18N)
DEFS += -DU_I18N_IMPLEMENTATION
LDFLAGS += $(LDFLAGSICUI18N)
DateFormat::create(EStyle timeStyle, EStyle dateStyle, const Locale& locale)
{
UErrorCode status = U_ZERO_ERROR;
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
char buffer[8];
int32_t count = locale.getKeywordValue("compat", buffer, sizeof(buffer), status);
// Macintosh produces duplicate definition linker errors with the explicit template
// instantiation.
//
-#if !defined(U_DARWIN)
+#if !U_PLATFORM_IS_DARWIN_BASED
template class U_I18N_API MaybeStackHeaderAndArray<decNumber, char, DEFAULT_DIGITS>;
#endif
/* Must be C linkage to pass function pointer to the sort function */
-#if !defined (OS390) && !defined (OS400)
-extern "C"
-#endif
+U_CDECL_BEGIN
+
static int32_t U_CALLCONV
ures_a_codepointSort(const void *context, const void *left, const void *right) {
//CompareContext *cmp=(CompareContext *)context;
((const UResAEntry *)right)->key);
}
+U_CDECL_END
static void ures_a_open(UResourceBundleAIterator *aiter, UResourceBundle *bund, UErrorCode *status) {
if(U_FAILURE(*status)) {
return NULL;
}
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
char buffer[8];
int32_t count = desiredLocale.getKeywordValue("compat", buffer, sizeof(buffer), status);
/*
**********************************************************************
-* Copyright (C) 1999-2007, International Business Machines Corporation
+* Copyright (C) 1999-2011, International Business Machines Corporation
* and others. All Rights Reserved.
**********************************************************************
* Date Name Description
#include "unicode/utypes.h"
#if !UCONFIG_NO_TRANSLITERATION
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
#include "unicode/uobject.h"
#include "unicode/parseerr.h"
U_NAMESPACE_END
-#endif /* #ifdef XP_CPLUSPLUS */
+#endif /* #ifdef __cplusplus */
/**
* Strip/convert the following from the transliterator rules:
hostStrID.truncate(hostStrID.length()-1);
default_zone = createSystemTimeZone(hostStrID);
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
// hostID points to a heap-allocated location on Windows.
uprv_free(const_cast<char *>(hostID));
#endif
#if !UCONFIG_NO_COLLATION
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
#include "unicode/normalizer2.h"
#include "unicode/unistr.h"
#endif
#define NFC_ZERO_CC_BLOCK_LIMIT_ 0x300
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
U_NAMESPACE_BEGIN
U_CAPI UBool U_EXPORT2
uprv_collIterateAtEnd(U_NAMESPACE_QUALIFIER collIterate *s);
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
U_NAMESPACE_BEGIN
/* get some memory */
void *ucol_getABuffer(const UCollator *coll, uint32_t size);
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
U_NAMESPACE_BEGIN
U_CFUNC int U_EXPORT2
ucol_getReorderCodesForLeadByte(const UCollator *uca, int leadByte, int16_t* returnReorderCodes, int returnCapacity);
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
/*
* Test whether a character is potentially "unsafe" for use as a collation
* starting point. Unsafe chars are those with combining class != 0 plus
htbyte = coll->unsafeCP[hash>>3];
return ((htbyte >> (hash & 7)) & 1);
}
-#endif /* XP_CPLUSPLUS */
+#endif /* __cplusplus */
/* The offsetBuffer in collIterate might need to be freed to avoid memory leaks. */
void ucol_freeOffsetBuffer(U_NAMESPACE_QUALIFIER collIterate *s);
#if !UCONFIG_NO_NORMALIZATION
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
U_NAMESPACE_BEGIN
U_NAMESPACE_END
-#endif /* XP_CPLUSPLUS */
+#endif /* __cplusplus */
/**
* Endianness swap function for binary spoof data.
/*
********************************************************************************
-* Copyright (C) 2005-2009, International Business Machines
+* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
#endif /* #if !UCONFIG_NO_FORMATTING */
-#endif // #ifdef U_WINDOWS
+#endif // U_PLATFORM_HAS_WIN32_API
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
#endif /* #if !UCONFIG_NO_FORMATTING */
-#endif // #ifdef U_WINDOWS
+#endif // U_PLATFORM_HAS_WIN32_API
#endif // __WINDTFMT
/*
********************************************************************************
-* Copyright (C) 2005-2007, International Business Machines
+* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
#endif /* #if !UCONFIG_NO_FORMATTING */
-#endif // #ifdef U_WINDOWS
+#endif // U_PLATFORM_HAS_WIN32_API
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#include "unicode/format.h"
#include "unicode/datefmt.h"
#endif /* #if !UCONFIG_NO_FORMATTING */
-#endif // #ifdef U_WINDOWS
+#endif // U_PLATFORM_HAS_WIN32_API
#endif // __WINNMFMT
/*
********************************************************************************
-* Copyright (C) 2009, International Business Machines
+* Copyright (C) 2009-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#include "wintzimpl.h"
/*
********************************************************************************
-* Copyright (C) 2008, International Business Machines
+* Copyright (C) 2008-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
/**
* \file
* \brief C API: Utilities for dealing w/ Windows time zones.
uprv_getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const UChar *icuid, int32_t length);
-#endif /* #ifdef U_WINDOWS */
+#endif /* U_PLATFORM_HAS_WIN32_API */
#endif /* __WINTZIMPL */
#******************************************************************************
#
-# Copyright (C) 1999-2009, International Business Machines
+# Copyright (C) 1999-2011, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n $(LIBCPPFLAGS) $(CPPFLAGSICUIO)
DEFS += -DU_IO_IMPLEMENTATION
LDFLAGS += $(LDFLAGSICUIO)
/*
******************************************************************************
*
-* Copyright (C) 1998-2010, International Business Machines
+* Copyright (C) 1998-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
#include "cstring.h"
#include "cmemory.h"
-#if defined(U_WINDOWS) && !defined(fileno)
+#if U_PLATFORM_USES_ONLY_WIN32_API && !defined(fileno)
/* Windows likes to rename Unix-like functions */
#define fileno _fileno
#endif
uprv_memset(result, 0, sizeof(UFILE));
result->fFileno = fileno(f);
-#ifdef U_WINDOWS
+#if U_PLATFORM_USES_ONLY_WIN32_API
if (0 <= result->fFileno && result->fFileno <= 2) {
/* stdin, stdout and stderr need to be special cased for Windows 98 */
#if _MSC_VER >= 1400
/*
******************************************************************************
*
- * Copyright (C) 1998-2010, International Business Machines
+ * Copyright (C) 1998-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
#define DELIM_PS 0x2029
/* TODO: is this correct for all codepages? Should we just use \n and let the converter handle it? */
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
static const UChar DELIMITERS [] = { DELIM_CR, DELIM_LF, 0x0000 };
static const uint32_t DELIMITERS_LEN = 2;
/* TODO: Default newline writing should be detected based upon the converter being used. */
/*
*
- * (C) Copyright IBM Corp. 1998-2009 - All Rights Reserved
+ * (C) Copyright IBM Corp. 1998-2011 - All Rights Reserved
*
*/
#include "unicode/utypes.h"
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
#include "unicode/uobject.h"
#endif
float fY;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
/**
* Used to hold a pair of (x, y) values which represent a point.
*
LE_MISSING_FONT_TABLE_ERROR = U_MISSING_RESOURCE_ERROR /**< The requested font table does not exist. */
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
/**
* Error codes returned by the LayoutEngine.
*
#******************************************************************************
#
-# Copyright (C) 1999-2007, International Business Machines
+# Copyright (C) 1999-2011, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(srcdir) -I$(srcdir)/.. -I$(top_srcdir)/common -I$(srcdir)/unicode $(LIBCPPFLAGS)
DEFS += -DU_LAYOUT_IMPLEMENTATION
LDFLAGS += $(LDFLAGSICULE)
#******************************************************************************
#
-# Copyright (C) 1999-2008, International Business Machines
+# Copyright (C) 1999-2011, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(srcdir) -I$(srcdir)/unicode -I$(srcdir)/.. -I$(top_srcdir)/common $(LIBCPPFLAGS)
DEFS += -DU_LAYOUTEX_IMPLEMENTATION
LDFLAGS += $(LDFLAGSICULX)
## Makefile.in for ICU - samples/cal
-## Copyright (c) 1999-2008, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = icucal$(EXEEXT)
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n
LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = uprint.o cal.o
## Makefile.in for ICU - samples/date
-## Copyright (c) 1999-2008, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = icudate$(EXEEXT)
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n
LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = uprint.o date.o
## Makefile.in for ICU - samples/layout
-## Copyright (c) 2001-2007, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
TARGET = gnomelayout
CTARGET = cgnomelayout
-CPPFLAGS += -DLE_USE_CMEMORY `pkg-config --cflags libgnomeui-2.0 freetype2 cairo` -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/layoutex -I$(top_srcdir)/layout -I$(top_srcdir) -g
+CPPFLAGS += -DLE_USE_CMEMORY `pkg-config --cflags libgnomeui-2.0 freetype2 cairo` -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/layoutex -I$(top_srcdir)/layout -I$(top_srcdir) -g
LIBS = $(LIBICULX) $(LIBICULE) $(LIBICUUC) $(LIBICUI18N) @LIBS@ @LIB_M@ `pkg-config --libs libgnomeui-2.0 freetype2 cairo`
#******************************************************************************
#
-# Copyright (C) 1999-2007, International Business Machines
+# Copyright (C) 1999-2011, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common $(LIBCPPFLAGS)
LDFLAGS += $(LDFLAGSICUDT)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-../common/unicode/platform.h: $(srcdir)/../common/unicode/platform.h.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=common/unicode/platform.h CONFIG_HEADERS= $(SHELL) ./config.status
-
ifneq ($(ENABLE_STATIC),)
$(TARGET): $(STATIC_OBJECTS)
$(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $^
# Simplify the path for Windows 98
BUILDDIR := $(BUILDDIR:TEST\\CINTLTST/../../=)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
# we define ICU_UNICODE_VERSION so we can test it
CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/ctestfw -I$(top_srcdir)/tools/toolutil
DEFS += -D'ICU_UNICODE_VERSION="$(UNICODE_VERSION)"' -D'ICU_VERSION="@VERSION@"' -D'ICUDATA_NAME="$(ICUDATA_PLATFORM_NAME)"' -D'U_TOPSRCDIR="$(top_srcdir)/"' -D'U_TOPBUILDDIR="$(BUILDDIR)"'
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2007, International Business Machines Corporation and
+ * Copyright (c) 1997-2011, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/* file name: cbiditst.h
#include "unicode/uchar.h"
#include "unicode/ubidi.h"
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
extern "C" {
#endif
extern const int
bidiTestCount;
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
}
#endif
#include "ccapitst.h"
/* for not including "cstring.h" -begin*/
-#ifdef U_WINDOWS
+#if U_PLATFORM_USES_ONLY_WIN32_API
# define ctest_stricmp(str1, str2) U_STANDARD_CPP_NAMESPACE _stricmp(str1, str2)
#elif defined(POSIX)
# define ctest_stricmp(str1, str2) U_STANDARD_CPP_NAMESPACE strcasecmp(str1, str2)
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2010, International Business Machines Corporation and
+ * Copyright (c) 1997-2011, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
const void *p;
UErrorCode errorCode = U_ZERO_ERROR;
#if U_CHARSET_FAMILY==U_EBCDIC_FAMILY
-# ifdef OS390
+# if U_PLATFORM == U_PF_OS390
static const char convName[] = "ibm-1047";
# else
static const char convName[] = "ibm-37";
/*
static UCollationResult winTest(void *collator, const int object, const UChar *source, const int sLen, const UChar *target, const int tLen) {
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
LCID lcid = (LCID)collator;
return (UCollationResult)CompareString(lcid, 0, source, sLen, target, tLen);
#else
austrdup(result), austrdup(testResultStrings[i]) );
}
-#if defined (U_DARWIN) /* add platforms here .. */
+#if U_PLATFORM == U_PF_DARWIN /* add platforms here .. */
log_verbose("Skipping potentially crashing test for mismatched varargs.\n");
#else
log_verbose("Note: the next is a platform dependent test. If it crashes, add an exclusion for your platform near %s:%d\n", __FILE__, __LINE__);
char tempMsgBug[256];
double a;
UErrorCode status = U_ZERO_ERROR;
-#ifdef OS390
+#if U_PLATFORM == U_PF_OS390
static const double val[] = { 0.01234, 123456789, 1.23e75, -3.141592653e-78 };
#else
static const double val[] = { 0.01234, 123456789, 1.23e300, -3.141592653e-271 };
};
static const double valParse[] =
{
-#ifdef OS390
+#if U_PLATFORM == U_PF_OS390
0.01234, 123460000, 1.23E75, -3.1416E-78,
0.01234, 123460000, 1.23E75, -3.1416E-78,
0.01234, 123456800, 1.23E75, -3.141593E-78,
#include <stdlib.h>
#include <stdio.h>
-#ifdef U_WINDOWS
+#if U_PLATFORM_USES_ONLY_WIN32_API
#include <io.h>
#else
#include <unistd.h>
/* test data swapping ------------------------------------------------------- */
-#ifdef OS400
+#if U_PLATFORM == U_PF_OS400
/* See comments in genccode.c on when this special implementation can be removed. */
static const struct {
double bogus;
-## Makefile.in for ICU - samples/tzdate
-## Copyright (c) 1999-2007, International Business Machines Corporation and
+## Makefile.in for ICU - test/compat
+## Copyright (c) 1999-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = tzdate$(EXEEXT)
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n
LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = tzdate.o
-# Copyright (c) 2001-2004 International Business Machines
+# Copyright (c) 2001-2011 International Business Machines
# Corporation and others. All Rights Reserved.
-pwin32.h
+# ICU 49 and later: no more platform-specific headers
# Simplify the path for Windows 98
BUILDDIR := $(BUILDDIR:TEST\\INTLTEST/../../=)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
DEFS += -D'U_TOPSRCDIR="$(top_srcdir)/"' -D'U_TOPBUILDDIR="$(BUILDDIR)"'
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M) $(LIB_THREAD)
#include "caltest.h" // for fieldName
#include <stdio.h> // for sprintf
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#include "windttst.h"
#endif
void DateFormatTest::TestHost(void)
{
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
Win32DateTimeTest::testLocales(this);
#endif
}
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2010, International Business Machines Corporation and
+ * Copyright (c) 1997-2011, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
char buffer[64]; // nos changed from 10 to 64
char danger = 'p'; // guard against overrunning the buffer (rtg)
-#ifdef U_WINDOWS
+#if defined(_MSC_VER)
sprintf(buffer, "%I64d", num);
#else
sprintf(buffer, "%lld", (long long)num);
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2010, International Business Machines Corporation and
+ * Copyright (c) 1997-2011, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
U_NAMESPACE_USE
-#ifdef OS390
+#if U_PLATFORM == U_PF_OS390
// avoid collision with math.h/log()
-// this must be after including utypes.h so that OS390 is actually defined
+// this must be after including utypes.h so that U_PLATFORM is actually defined
#pragma map(IntlTest::log( const UnicodeString &message ),"logos390")
#endif
/***********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2010, International Business Machines Corporation
+ * Copyright (c) 1997-2011, International Business Machines Corporation
* and others. All Rights Reserved.
***********************************************************************/
void
NumberFormatRoundTripTest::test(NumberFormat *fmt)
{
-#if IEEE_754 && !defined(OS400)
+#if IEEE_754 && U_PLATFORM != U_PF_OS400
test(fmt, uprv_getNaN());
test(fmt, uprv_getInfinity());
test(fmt, -uprv_getInfinity());
test(fmt, uprv_floor((randomDouble(10000))));
test(fmt, randomDouble(1e50));
test(fmt, randomDouble(1e-50));
-#if !defined(OS390) && !defined(OS400)
+#if !(U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400)
test(fmt, randomDouble(1e100));
#elif IEEE_754
- test(fmt, randomDouble(1e75)); /*OS390 and OS400*/
+ test(fmt, randomDouble(1e75));
#endif /* OS390 and OS400 */
// {sfb} When formatting with a percent instance, numbers very close to
// DBL_MAX will fail the round trip. This is because:
DecimalFormat *df = dynamic_cast<DecimalFormat *>(fmt);
if(df != NULL)
{
-#if !defined(OS390) && !defined(OS400)
+#if !(U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400)
/* DBL_MAX/2 is here because randomDouble does a *2 in the math */
test(fmt, randomDouble(DBL_MAX/2.0) / df->getMultiplier());
#elif IEEE_754
- test(fmt, randomDouble(1e75) / df->getMultiplier());
+ test(fmt, randomDouble(1e75) / df->getMultiplier());
#else
- test(fmt, randomDouble(1e65) / df->getMultiplier()); /*OS390*/
+ test(fmt, randomDouble(1e65) / df->getMultiplier());
#endif
}
// These machines and compilers don't fully support denormalized doubles,
test(fmt, randomDouble(1e-292));
test(fmt, randomDouble(1e-100));
-#elif defined(OS390) || defined(OS400)
- // i5/OS (OS400) throws exceptions on denormalized numbers
+#elif U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400
+ // i5/OS (OS/400) throws exceptions on denormalized numbers
# if IEEE_754
test(fmt, randomDouble(1e-78));
test(fmt, randomDouble(1e-78));
a = af.getLong();
else if (af.getType() == Formattable::kDouble) {
a = af.getDouble();
-#if defined(OS390) || defined(OS400)
+#if U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400
// S/390 will show a failure like this:
//| -3.141592652999999e-271 -format-> -3.1416E-271
//| -parse-> -3.1416e-271
void NumberFormatTest::TestHost()
{
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
Win32NumberTest::testLocales(this);
#endif
Locale loc("en_US@compat=host");
UnicodeString temp;
FieldPosition pos(FieldPosition::DONT_CARE);
-#if defined(U_HPUX)
+#if U_PLATFORM == U_PF_HPUX
d1 = 0.0 * -1.0; // old HPUX compiler ignores volatile keyword
#else
d1 *= -1.0; // Some compilers have a problem with defining -0.0
FieldPosition pos(FieldPosition::DONT_CARE);
logln("pattern: \"" + df->toPattern(temp) + "\"");
-#if defined(U_HPUX)
+#if U_PLATFORM == U_PF_HPUX
d = 0.0 * -1.0; // old HPUX compiler ignores volatile keyword
#else
d *= -1.0; // Some compilers have a problem with defining -0.0
/* @bug 4110936
* DecimalFormat.setMaximumIntegerDigits() works incorrectly.
*/
-#ifdef OS390
+#if U_PLATFORM == U_PF_OS390
# define MAX_INT_DIGITS 70
#else
# define MAX_INT_DIGITS 128
volatile double d1 = 0.0; // volatile to prevent code optimization
double d2 = -0.0001;
-#if defined(U_HPUX)
+#if U_PLATFORM == U_PF_HPUX
d1 = 0.0 * -1.0; // old HPUX compiler ignores volatile keyword
#else
d1 *= -1.0; // Some compilers have a problem with defining -0.0
logln(UnicodeString("") +
d + " -> " +
'"' + s + '"' + " -> " + e);
-#if (defined(OS390) && !defined(IEEE_754)) || defined(OS400)
+#if (U_PLATFORM == U_PF_OS390 && !defined(IEEE_754)) || U_PLATFORM == U_PF_OS400
if (e != 0.0) {
#else
if (e != 0.0 || 1.0/e > 0.0) {
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1999-2009, International Business Machines Corporation and
+ * Copyright (c) 1999-2011, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
#include <string.h>
#include <ctype.h> // tolower, toupper
-#if !defined(U_WINDOWS) && !defined(XP_MAC) && !defined(U_RHAPSODY)
-#define POSIX 1
+#if U_PLATFORM_HAS_WIN32_API
+ /* Prefer native Windows APIs even if POSIX is implemented (i.e., on Cygwin). */
+# undef POSIX
+#elif U_PLATFORM_IMPLEMENTS_POSIX
+# define POSIX
+#else
+# undef POSIX
#endif
/* Needed by z/OS to get usleep */
-#if defined(OS390)
+#if U_PLATFORM == U_PF_OS390
#define __DOT1 1
#define __UU
#define _XOPEN_SOURCE_EXTENDED 1
/*#include "platform_xopen_source_extended.h"*/
#endif
-#if defined(POSIX) || defined(U_SOLARIS) || defined(U_AIX) || defined(U_HPUX)
+#if defined(POSIX)
#define HAVE_IMP
#if (ICU_USE_THREADS == 1)
#define __EXTENSIONS__
#endif
-#if defined(OS390)
+#if U_PLATFORM == U_PF_OS390
#include <sys/types.h>
#endif
-#if !defined(OS390)
+#if U_PLATFORM != U_PF_OS390
#include <signal.h>
#endif
#include "unicode/calendar.h"
#include "ucaconf.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#define HAVE_IMP
# define VC_EXTRALEAN
// class SimpleThread NULL Implementation
//
//-----------------------------------------------------------------------------------
-#elif defined XP_MAC
+#elif U_PLATFORM == U_PF_CLASSIC_MACOS
// since the Mac has no preemptive threading (at least on MacOS 8), only
// cooperative threading, threads are a no-op. We have no yield() calls
// system level cleanup has happened.
//
//-----------------------------------------------------------------------------------
-#if defined(POSIX)||defined(U_SOLARIS)||defined(U_AIX)||defined(U_HPUX)
+#if defined(POSIX)
#define HAVE_IMP
struct PosixThreadImplementation
#else
if (attrIsInitialized == FALSE) {
rc = pthread_attr_init(&attr);
-#if defined(OS390)
+#if U_PLATFORM == U_PF_OS390
{
int detachstate = 0; // jdc30: detach state of zero causes
//threads created with this attr to be in
void SimpleThread::sleep(int32_t millis)
{
-#ifdef U_SOLARIS
+#if U_PLATFORM == U_PF_SOLARIS
sigignore(SIGALRM);
#endif
#ifdef HPUX_CMA
cma_sleep(millis/100);
-#elif defined(U_HPUX) || defined(OS390)
+#elif U_PLATFORM == U_PF_HPUX || U_PLATFORM == U_PF_OS390
millis *= 1000;
while(millis >= 1000000) {
usleep(999999);
#endif
}
-#if defined(U_WINDOWS) && defined(_MSC_VER)
+#if defined(_MSC_VER)
#include <vector>
#endif
void
StringTest::TestSTLCompatibility() {
-#if defined(U_WINDOWS) && defined(_MSC_VER)
+#if defined(_MSC_VER)
/* Just make sure that it compiles with STL's placement new usage. */
std::vector<UnicodeString> myvect;
myvect.push_back(UnicodeString("blah"));
#include "unicode/uloc.h"
#include "unicode/locid.h"
#include "putilimp.h"
-#if !defined(U_WINDOWS) && !defined(XP_MAC) && !defined(U_RHAPSODY)
-#define POSIX 1
+
+#if U_PLATFORM_HAS_WIN32_API
+ /* Prefer native Windows APIs even if POSIX is implemented (i.e., on Cygwin). */
+# undef POSIX
+#elif U_PLATFORM_IMPLEMENTS_POSIX
+# define POSIX
+#else
+# undef POSIX
#endif
/* Needed by z/OS to get usleep */
-#if defined(OS390)
+#if U_PLATFORM == U_PF_OS390
#define __DOT1 1
#define __UU
#define _XOPEN_SOURCE_EXTENDED 1
#include <unistd.h>
/*#include "platform_xopen_source_extended.h"*/
#endif
-#if defined(POSIX) || defined(U_SOLARIS) || defined(U_AIX) || defined(U_HPUX)
+#if defined(POSIX)
#define HAVE_IMP
#define __EXTENSIONS__
#endif
-#if defined(OS390)
+#if U_PLATFORM == U_PF_OS390
#include <sys/types.h>
#endif
-#if !defined(OS390)
+#if U_PLATFORM != U_PF_OS390
#include <signal.h>
#endif
DecimalFormat *s = (DecimalFormat*)fFormat;
logln((UnicodeString)" Pattern " + s->toPattern(str));
-#if defined(OS390) || defined(OS400)
+#if U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400
tryIt(-2.02147304840132e-68);
tryIt(3.88057859588817e-68); // Test rounding when only some digits are shown because exponent is close to -maxfrac
tryIt(-2.64651110485945e+65); // Overflows to +INF when shown as a percent
// These fail due to round-off
// The least significant digit drops by one during each format-parse cycle.
// Both numbers DON'T have a round-off problem when multiplied by 100! (shown as %)
-#ifdef OS390
+#if U_PLATFORM == U_PF_OS390
tryIt(-9.18228054496402e+64);
tryIt(-9.69413034454191e+64);
#else
tryIt(-9.69413034454191e+273);
#endif
-#ifndef OS390
+#if U_PLATFORM != U_PF_OS390
tryIt(1.234e-200);
tryIt(-2.3e-168);
// simple remainder checks
remainderTest(7.0, 2.5, -0.5);
remainderTest(7.0, -2.5, -0.5);
-#ifndef OS390
+#if U_PLATFORM != U_PF_OS390
// ### TODO:
// The following tests fails on S/390 with IEEE support in release builds;
// debug builds work.
if((pzero <= nzero) != TRUE) {
errln("FAIL: 0.0 <= -0.0 returned FALSE, should be TRUE.");
}
-#ifndef OS400 /* OS/400 will generate divide by zero exception MCH1214 */
+#if U_PLATFORM != U_PF_OS400 /* OS/400 will generate divide by zero exception MCH1214 */
if(uprv_isInfinite(1/pzero) != TRUE) {
errln("FAIL: isInfinite(1/0.0) returned FALSE, should be TRUE.");
}
TESTCLASSID_FACTORY(IndianCalendar, Calendar::createInstance(Locale("@calendar=indian"), status));
TESTCLASSID_FACTORY(ChineseCalendar, Calendar::createInstance(Locale("@calendar=chinese"), status));
TESTCLASSID_FACTORY(TaiwanCalendar, Calendar::createInstance(Locale("@calendar=roc"), status));
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
TESTCLASSID_FACTORY(Win32DateFormat, DateFormat::createDateInstance(DateFormat::kFull, Locale("@compat=host")));
TESTCLASSID_FACTORY(Win32NumberFormat, NumberFormat::createInstance(Locale("@compat=host"), status));
#endif
/*
********************************************************************************
-* Copyright (C) 2005-2009, International Business Machines
+* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
#endif /* #if !UCONFIG_NO_FORMATTING */
-#endif /* #ifdef U_WINDOWS */
+#endif /* U_PLATFORM_HAS_WIN32_API */
/*
********************************************************************************
-* Copyright (C) 2005-2006, International Business Machines
+* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
#endif /* #if !UCONFIG_NO_FORMATTING */
-#endif // #ifdef U_WINDOWS
+#endif // U_PLATFORM_HAS_WIN32_API
#endif // __WINDTTST
/*
********************************************************************************
-* Copyright (C) 2005-2009, International Business Machines
+* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
#endif /* #if !UCONFIG_NO_FORMATTING */
-#endif /* #ifdef U_WINDOWS */
+#endif /* U_PLATFORM_HAS_WIN32_API */
/*
********************************************************************************
-* Copyright (C) 2005-2006, International Business Machines
+* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
#endif /* #if !UCONFIG_NO_FORMATTING */
-#endif // #ifdef U_WINDOWS
+#endif // U_PLATFORM_HAS_WIN32_API
#endif // __WINNMTST
/*
********************************************************************************
-* Copyright (C) 2005-2009, International Business Machines
+* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
#endif /* #if !UCONFIG_NO_FORMATTING */
-#endif /* #ifdef U_WINDOWS */
+#endif /* U_PLATFORM_HAS_WIN32_API */
/*
********************************************************************************
-* Copyright (C) 2005-2009, International Business Machines
+* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
#endif /* #if !UCONFIG_NO_FORMATTING */
-#endif // #ifdef U_WINDOWS
+#endif // U_PLATFORM_HAS_WIN32_API
#endif // __WINUTIL
#******************************************************************************
#
-# Copyright (C) 1999-2010, International Business Machines
+# Copyright (C) 1999-2011, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
# Simplify the path for Windows 98
BUILDDIR := $(BUILDDIR:TEST\\IOTEST/../../=)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/ctestfw -I$(top_srcdir)/io
DEFS += -D'U_TOPSRCDIR="$(top_srcdir)/"' -D'U_TOPBUILDDIR="$(BUILDDIR)"'
LIBS = $(LIBCTESTFW) $(LIBICUTOOLUTIL) $(LIBICUIO) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
#include <string.h>
U_CDECL_BEGIN
-#ifdef U_WINDOWS
+#if U_PLATFORM_USES_ONLY_WIN32_API
const UChar NEW_LINE[] = {0x0d,0x0a,0};
const char C_NEW_LINE[] = {0x0d,0x0a,0};
#define UTF8_NEW_LINE "\x0d\x0a"
## Makefile.in for ICU - test/letest
-## Copyright (c) 2001-2007, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
# Simplify the path for Windows 98
BUILDDIR := $(BUILDDIR:TEST\\CINTLTST/../../=)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
-
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/ctestfw -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/layout -I$(top_srcdir)/layoutex -I$(top_srcdir)
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/ctestfw -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/layout -I$(top_srcdir)/layoutex -I$(top_srcdir)
DEFS += -D'U_TOPSRCDIR="$(top_srcdir)/"' -D'U_TOPBUILDDIR="$(BUILDDIR)"'
LIBS = $(LIBICULX) $(LIBICULE) $(LIBICUUC) $(LIBICUI18N) $(LIBCTESTFW) $(LIBICUTOOLUTIL) @LIBS@ @LIB_M@
/*
*******************************************************************************
*
- * Copyright (C) 1999-2007, International Business Machines
+ * Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
float *positions;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct TestResult TestResult;
#endif
/***************************************************************************
*
-* Copyright (C) 1998-2008, International Business Machines
+* Copyright (C) 1998-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
************************************************************************/
le_uint32 length;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct DirectoryEntry DirectoryEntry;
#endif
DirectoryEntry tableDirectory[ANY_NUMBER];
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct SFNTDirectory SFNTDirectory;
#endif
le_uint32 encodingOffset;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct CMAPEncodingSubtableHeader CMAPEncodingSubtableHeader;
#endif
CMAPEncodingSubtableHeader encodingSubtableHeaders[ANY_NUMBER];
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct CMAPTable CMAPTable;
#endif
le_uint16 language;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct CMAPEncodingSubtable CMAPEncodingSubtable;
#endif
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
struct CMAPFormat0Encoding : CMAPEncodingSubtable
{
le_uint8 glyphIndexArray[256];
le_uint16 idRangeOffset;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct CMAPFormat2Subheader CMAPFormat2Subheader;
#endif
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
struct CMAPFormat2Encoding : CMAPEncodingSubtable
{
le_uint16 subHeadKeys[256];
typedef struct CMAPFormat2Encoding CMAPFormat2Encoding;
#endif
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
struct CMAPFormat4Encoding : CMAPEncodingSubtable
{
le_uint16 segCountX2;
typedef struct CMAPFormat4Encoding CMAPFormat4Encoding;
#endif
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
struct CMAPFormat6Encoding : CMAPEncodingSubtable
{
le_uint16 firstCode;
le_uint32 language;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct CMAPEncodingSubtable32 CMAPEncodingSubtable32;
#endif
le_uint32 startGlyphCode;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct CMAPGroup CMAPGroup;
#endif
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
struct CMAPFormat8Encoding : CMAPEncodingSubtable32
{
le_uint32 is32[65536/32];
typedef struct CMAPFormat8Encoding CMAPFormat8Encoding;
#endif
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
struct CMAPFormat10Encoding : CMAPEncodingSubtable32
{
le_uint32 startCharCode;
typedef struct CMAPFormat10Encoding CMAPFormat10Encoding;
#endif
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
struct CMAPFormat12Encoding : CMAPEncodingSubtable32
{
le_uint32 nGroups;
le_uint32 ad;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct BigDate BigDate;
#endif
le_int16 glyphDataFormat;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct HEADTable HEADTable;
#endif
le_uint16 maxComponentDepth;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct MAXPTable MAXPTable;
#endif
le_uint16 numOfLongHorMetrics;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct HHEATable HHEATable;
#endif
le_int16 leftSideBearing;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct LongHorMetric LongHorMetric;
#endif
/* le_int16 leftSideBearing[ANY_NUMBER]; ANY_NUMBER = numGlyphs - numOfLongHorMetrics */
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct HMTXTable HMTXTable;
#endif
le_uint16 offset;
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct NameRecord NameRecord;
#endif
NameRecord nameRecords[ANY_NUMBER];
};
-#ifndef XP_CPLUSPLUS
+#ifndef __cplusplus
typedef struct NAMETable NAMETable;
#endif
// Stubs for Windows API functions when building on UNIXes.
//
-#if defined(U_WINDOWS)
+#if U_PLATFORM_USES_ONLY_WIN32_API
// do nothing
#else
#define _UNICODE
## Makefile.in for ICU - test/perf/ubrkperf
-## Copyright (c) 2001-2010, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = DateFmtPerf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_builddir)/i18n -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_builddir)/i18n -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = DateFmtPerf.o
## Makefile.in for ICU - test/perf/charperf
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = charperf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = charperf.o
## Makefile.in for ICU - test/perf/collationperf
-## Copyright (c) 2001-2009, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = collperf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = collperf.o
## Makefile.in for ICU - test/perf/collperf
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = collperf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = collperf.o
/********************************************************************
* COPYRIGHT:
-* Copyright (C) 2001-2006 IBM, Inc. All Rights Reserved.
+* Copyright (C) 2001-2011 IBM, Inc. All Rights Reserved.
*
********************************************************************/
locale = "en_US"; // set default locale
}
- //#ifdef U_WINDOWS
+ //#if U_PLATFORM_USES_ONLY_WIN32_API
if (options[i].doesOccur) {
char *endp;
int tmp = strtol(options[i].value, &endp, 0);
## Makefile.in for ICU - test/perf/collperf
-## Copyright (c) 2001-2007, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = collperf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = convperf.o
## Makefile.in for ICU - test/perf/dicttrieperf
-## Copyright (c) 2001-2010, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = dicttrieperf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = dicttrieperf.o
## Makefile.in for ICU - test/perf/normperf
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = normperf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = normperf.o
/*
**********************************************************************
-* Copyright (c) 2010,International Business Machines
+* Copyright (c) 2010-2011,International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
**********************************************************************
// Stubs for Windows API functions when building on UNIXes.
//
-#if defined(U_WINDOWS)
+#if U_PLATFORM_USES_ONLY_WIN32_API
// do nothing
#else
#define _UNICODE
/*
**********************************************************************
-* Copyright (c) 2002-2006, International Business Machines
+* Copyright (c) 2002-2011, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
**********************************************************************
// Stubs for Windows API functions when building on UNIXes.
//
-#if defined(U_WINDOWS)
+#if U_PLATFORM_USES_ONLY_WIN32_API
// do nothing
#else
#define _UNICODE
}
#endif
-#if defined(U_WINDOWS)
+#if U_PLATFORM_HAS_WIN32_API
int32_t WinNormNFD(const UChar* src, int32_t srcLen, UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
return FoldStringW(MAP_COMPOSITE,src,srcLen,dest,dstLen);
## Makefile.in for ICU - test/perf/strsrchperf
-## Copyright (c) 2008, International Business Machines Corporation and
+## Copyright (c) 2008-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = strsrchperf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = strsrchperf.o
## Makefile.in for ICU - test/perf/ubrkperf
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = ubrkperf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = ubrkperf.o
/********************************************************************
* COPYRIGHT:
- * Copyright (C) 2001-2008 International Business Machines Corporation
+ * Copyright (C) 2001-2011 International Business Machines Corporation
* and others. All Rights Reserved.
*
********************************************************************/
#if 0
-#ifdef U_DARWIN
+#if U_PLATFORM_IS_DARWIN_BASED
#include <ApplicationServices/ApplicationServices.h>
enum{
kUCTextBreakAllMask = (kUCTextBreakClusterMask | kUCTextBreakWordMask | kUCTextBreakLineMask)
elapsedTime = timeGetTime()-startTime;
} else if(opt_mac) {
-#ifdef U_DARWIN
+#if U_PLATFORM_IS_DARWIN_BASED
createMACBrkIt();
UniChar* filePtr = text;
OSStatus status = noErr;
/*
**********************************************************************
-* Copyright (c) 2002-2005, International Business Machines
+* Copyright (c) 2002-2011, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
**********************************************************************
};
class DarwinBreakFunction : public UPerfFunction {
-#ifdef U_DARWIN
public:
virtual void call(UErrorCode *status) {};
-#else
-public:
- virtual void call(UErrorCode *status) {};
-#endif
};
class BreakIteratorPerformanceTest : public UPerfTest {
/********************************************************************
* COPYRIGHT:
- * Copyright (C) 2001-2005 IBM, Inc. All Rights Reserved.
+ * Copyright (C) 2001-2011 IBM, Inc. All Rights Reserved.
*
********************************************************************/
/********************************************************************************
#include <unicode/brkiter.h>
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#include <windows.h>
#else
//
-#ifdef U_DARWIN
+#if U_PLATFORM_IS_DARWIN_BASED
#include <ApplicationServices/ApplicationServices.h>
enum{
kUCTextBreakAllMask = (kUCTextBreakClusterMask | kUCTextBreakWordMask | kUCTextBreakLineMask)
elapsedTime = timeGetTime()-startTime;
} else if(opt_mac) {
-#ifdef U_DARWIN
+#if U_PLATFORM_IS_DARWIN_BASED
createMACBrkIt();
UniChar* filePtr = text;
OSStatus status = noErr;
## Makefile.in for ICU - test/perf/unisetperf
-## Copyright (c) 2001-2007, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = unisetperf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = unisetperf.o
## Makefile.in for ICU - test/perf/usetperf
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = usetperf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = usetperf.o bitset.o
## Makefile.in for ICU - test/perf/ustrperf
-## Copyright (c) 2001-2008, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = stringperf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = stringperf.o
## Makefile.in for ICU - test/perf/utfperf
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = utfperf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = utfperf.o
## Makefile.in for ICU - test/perf/utrie2perf
-## Copyright (c) 2001-2008, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = utrie2perf
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = utrie2perf.o
## Makefile.in for ICU - test/testmap
-## Copyright (c) 2003-2006, International Business Machines Corporation and
+## Copyright (c) 2003-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
TARGET = testmap$(EXEEXT)
#DEFS = @DEFS@
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n
#CFLAGS += @CFLAGS@
#CXXFLAGS = @CXXFLAGS@
## Makefile.in for ICU - test/thaitest
-## Copyright (c) 2003, International Business Machines Corporation and
+## Copyright (c) 2003-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
TARGET = thaitest$(EXEEXT)
DEFS = @DEFS@
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n
#CFLAGS += @CFLAGS@
#CXXFLAGS = @CXXFLAGS@
## Makefile.in for ICU - test/threadtest
-## Copyright (c) 2001, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
TARGET = threadtest
DEFS = @DEFS@
-CPPFLAGS = @CPPFLAGS@ -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n
+CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/common -I$(top_srcdir)/i18n
CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
ENABLE_RPATH = @ENABLE_RPATH@
//
//********************************************************************
-// Copyright (C) 2002-2005, International Business Machines
+// Copyright (C) 2002-2011, International Business Machines
// Corporation and others. All Rights Reserved.
//********************************************************************
//
// Windows specific code for starting threads
//
//------------------------------------------------------------------------------
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#include "Windows.h"
#include "process.h"
#******************************************************************************
#
-# Copyright (C) 1999-2010, International Business Machines
+# Copyright (C) 1999-2011, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil -I$(srcdir) $(LIBCPPFLAGS) $(CPPFLAGSCTESTFW)
DEFS += -DT_CTEST_IMPLEMENTATION
LDFLAGS += $(LDFLAGSCTESTFW)
/*
*****************************************************************************************
- * Copyright (C) 2004-2007, International Business Machines
+ * Copyright (C) 2004-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*****************************************************************************************
*/
#define T_CTEST_IMPORT
#endif
-#if defined(U_WINDOWS)
+#if defined(_MSC_VER)
#define T_CTEST_EXPORT2 __cdecl
#else
#define T_CTEST_EXPORT2
#include "unicode/utypes.h"
-#if defined(U_WINDOWS)
+#if U_PLATFORM_HAS_WIN32_API
# define VC_EXTRALEAN
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#else
-# if defined(OS390)
+# if U_PLATFORM == U_PF_OS390
# define __UU /* Universal Unix - for struct timeval */
# endif
# include <time.h>
* }
*
* retVal= fn(fileLines[line].name,len,dest,destCapacity,&error);
- * #if defined(U_WINDOWS)
+ * #if U_PLATFORM_HAS_WIN32_API
* if(retVal==0 ){
* fprintf(stderr,"Normalization of string in Windows API failed for mode %s. ErrorNo: %i at line number %i\n",mode,GetLastError(),line);
* return 0;
typedef void FuntionToBeTimed(void* param);
-#if defined(U_WINDOWS)
+#if U_PLATFORM_HAS_WIN32_API
struct UTimer{
LARGE_INTEGER start;
## Makefile.in for ICU - tools/genbrk
-## Copyright (c) 2002-2006 International Business Machines Corporation and
+## Copyright (c) 2002-2011 International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
## Makefile.in for ICU - tools/genccode
-## Copyright (c) 1999-2008, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Steven R. Loomis
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
/*
*******************************************************************************
- * Copyright (C) 1999-2008, International Business Machines
+ * Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: gennames.c
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
# define VC_EXTRALEAN
# define WIN32_LEAN_AND_MEAN
# define NOUSER
#include <time.h>
#endif
-#ifdef U_LINUX
+#if U_PLATFORM_IS_LINUX_BASED
# define U_ELF
#endif
#include "uoptions.h"
#include "pkg_genc.h"
-#if defined(U_WINDOWS) || defined(U_ELF)
+#if U_PLATFORM_HAS_WIN32_API || defined(U_ELF)
#define CAN_GENERATE_OBJECTS
#endif
## Makefile.in for ICU - tools/gencfu
-## Copyright (c) 2009 International Business Machines Corporation and
+## Copyright (c) 2009-2011 International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
## Makefile.in for ICU - tools/gencmn
-## Copyright (c) 1999-2008, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Steven R. Loomis
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
## Makefile.in for ICU - tools/gencnval
-## Copyright (c) 1999-2005, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Steven R. Loomis
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
## Makefile.in for ICU - tools/genctd
-## Copyright (c) 2002-2006 International Business Machines Corporation and
+## Copyright (c) 2002-2011 International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
## Makefile.in for ICU - tools/gennorm2
-## Copyright (c) 2009-2010, International Business Machines Corporation and
+## Copyright (c) 2009-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Steven R. Loomis/Markus W. Scherer
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
#################################################################################
## Makefile.in for ICU - tools/genrb #
-## Copyright (c) 1999-2009, International Business Machines Corporation and #
+## Copyright (c) 1999-2011, International Business Machines Corporation and #
## others. All Rights Reserved. #
#################################################################################
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
DERB = $(BINDIR)/$(DERB_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
#include <stdio.h>
#include <ctype.h>
-#if defined(U_WINDOWS) || defined(U_CYGWIN) || defined(U_MINGW)
+#if U_PLATFORM_HAS_WIN32_API
#include <io.h>
#include <fcntl.h>
#define USE_FILENO_BINARY_MODE 1
if (!(fromICUData = !uprv_strcmp(inputDir, "-"))) {
UBool absfilename = *arg == U_FILE_SEP_CHAR;
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
if (!absfilename) {
absfilename = (uprv_strlen(arg) > 2 && isalpha(arg[0])
&& arg[1] == ':' && arg[2] == U_FILE_SEP_CHAR);
if (tostdout) {
out = stdout;
-#if defined(U_WINDOWS) || defined(U_CYGWIN) || defined(U_MINGW)
+#if U_PLATFORM_HAS_WIN32_API
if (setmode(fileno(out), O_BINARY) == -1) {
fprintf(stderr, "%s: couldn't set standard output to binary mode\n", pname);
return 4;
## Makefile.in for ICU - tools/gensprep
-## Copyright (c) 2001-2005, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Steven R. Loomis/Markus W. Scherer
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
## Makefile.in for ICU - tools/gentest
-## Copyright (c) 1999-2008, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Madhu Katragadda
## Target information
TARGET = gentest$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil -I$(top_srcdir)/tools/ctestfw
CPPFLAGS+= -I$(top_srcdir)/i18n
LIBS = $(LIBCTESTFW) $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
## Target information
TARGET = icuinfo$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil -I$(top_srcdir)/tools/ctestfw
CPPFLAGS+= -I$(top_srcdir)/i18n
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
ICUINFO_OPTS=-i ../../data/out/build/$(ICUDATA_PLATFORM_NAME)
-CPPFLAGS+= "-DU_PLATFORM=\"@platform@\"" "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@CC@\"" "-DU_CXX=\"@CXX@\""
+CPPFLAGS+= "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@CC@\"" "-DU_CXX=\"@CXX@\""
## List of phony targets
.PHONY : all all-local install install-local clean clean-local \
/*
*******************************************************************************
*
-* Copyright (C) 1999-2010, International Business Machines
+* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
*/
static const char *getPlatform()
{
-#if defined(U_PLATFORM)
- return U_PLATFORM;
-#elif defined(U_WINDOWS)
- return "Windows";
-#elif defined(U_PALMOS)
- return "PalmOS";
-#elif defined(_PLATFORM_H)
- return "Other (POSIX-like)";
+#if U_PLATFORM_HAS_WIN32_API
+ return "Windows";
+#elif U_PLATFORM == U_PF_UNKNOWN
+ return "unknown"
#else
- return "unknown"
+ return "Other (POSIX-like)";
#endif
}
printf("Milliseconds since Epoch: %.0f\n", uprv_getUTCtime());
}
-void cmd_version(UBool noLoad)
+void cmd_version(UBool noLoad, UErrorCode &errorCode)
{
UVersionInfo icu;
char str[200];
printf("Compiled-Unicode-Version: %s\n", U_UNICODE_VERSION);
u_getUnicodeVersion(icu);
u_versionToString(icu, str);
- printf("Runtime-Unicode-Version: %s\n", U_UNICODE_VERSION);
+ printf("Runtime-Unicode-Version: %s\n", str);
printf("Platform: %s\n", getPlatform());
+ printf("U_PLATFORM: %d\n", U_PLATFORM);
+
+ union {
+ uint8_t byte;
+ uint16_t word;
+ } u;
+ u.word=0x0100;
+ if(U_IS_BIG_ENDIAN==u.byte) {
+ printf("U_IS_BIG_ENDIAN: %d\n", U_IS_BIG_ENDIAN);
+ } else {
+ fprintf(stderr, " error: U_IS_BIG_ENDIAN=%d != %d=actual 'is big endian'\n",
+ U_IS_BIG_ENDIAN, u.byte);
+ errorCode=U_INTERNAL_PROGRAM_ERROR;
+ }
+
+ if(U_SIZEOF_WCHAR_T==sizeof(wchar_t)) {
+ printf("U_SIZEOF_WCHAR_T: %d\n", U_SIZEOF_WCHAR_T);
+ } else {
+ fprintf(stderr, " error: U_SIZEOF_WCHAR_T=%d != %d=sizeof(wchar_t)\n",
+ U_SIZEOF_WCHAR_T, (int)sizeof(wchar_t));
+ errorCode=U_INTERNAL_PROGRAM_ERROR;
+ }
+
+ int charsetFamily;
+ if('A'==0x41) {
+ charsetFamily=U_ASCII_FAMILY;
+ } else if('A'==0xc1) {
+ charsetFamily=U_EBCDIC_FAMILY;
+ } else {
+ charsetFamily=-1; // unknown
+ }
+ if(U_CHARSET_FAMILY==charsetFamily) {
+ printf("U_CHARSET_FAMILY: %d\n", U_CHARSET_FAMILY);
+ } else {
+ fprintf(stderr, " error: U_CHARSET_FAMILY=%d != %d=actual charset family\n",
+ U_CHARSET_FAMILY, charsetFamily);
+ errorCode=U_INTERNAL_PROGRAM_ERROR;
+ }
+
#if defined(U_BUILD)
printf("Build: %s\n", U_BUILD);
#if defined(U_HOST)
cmd_listplugins();
didSomething = TRUE;
}
-
+
if(options[3].doesOccur) {
- cmd_version(FALSE);
+ cmd_version(FALSE, errorCode);
didSomething = TRUE;
}
-
+
if(options[6].doesOccur) { /* 2nd part of version: cleanup */
cmd_cleanup();
didSomething = TRUE;
}
-
+
if(!didSomething) {
- cmd_version(FALSE); /* at least print the version # */
+ cmd_version(FALSE, errorCode); /* at least print the version # */
}
return U_FAILURE(errorCode);
## Makefile.in for ICU - tools/icupkg
-## Copyright (c) 1999-2006, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Steven R. Loomis
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
## Makefile.in for ICU - tools/icuswap
-## Copyright (c) 1999-2008, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Steven R. Loomis
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
## Makefile.in for ICU - tools/makeconv
-## Copyright (c) 1999-2005, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Stephen F. Booth
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
## Makefile.in for ICU - tools/pkgdata
-## Copyright (c) 1999-2009, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
## others. All Rights Reserved.
## Steven R. Loomis
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
DEFS += -DUDATA_SO_SUFFIX=\".$(SO)\" -DSTATIC_O=\"$(STATIC_O)\"
LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
#include "unicode/utypes.h"
#if U_HAVE_POPEN
-#if (defined(U_CYGWIN) || defined(U_MINGW)) && defined(__STRICT_ANSI__)
+#if (U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(__STRICT_ANSI__)
/* popen/pclose aren't defined in strict ANSI on Cygwin and MinGW */
#undef __STRICT_ANSI__
#endif
#include "pkgtypes.h"
U_CDECL_END
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
#ifdef __GNUC__
#define WINDOWS_WITH_GNUC
#else
#define WINDOWS_WITH_MSVC
#endif
#endif
-#if !defined(WINDOWS_WITH_MSVC) && !defined(U_LINUX)
+#if !defined(WINDOWS_WITH_MSVC) && !U_PLATFORM_IS_LINUX_BASED
#define BUILD_DATA_WITHOUT_ASSEMBLY
#endif
-#if defined(WINDOWS_WITH_MSVC) || defined(U_LINUX)
+#if defined(WINDOWS_WITH_MSVC) || U_PLATFORM_IS_LINUX_BASED
#define CAN_WRITE_OBJ_CODE
#endif
-#if defined(U_CYGWIN) || defined(CYGWINMSVC)
+#if U_PLATFORM == U_PF_CYGWIN || defined(CYGWINMSVC)
#define USING_CYGWIN
#endif
* the data to generate the final data library. This can
* increase the performance of the pkdata tool.
*/
-#if defined(OS400)
+#if U_PLATFORM == U_PF_OS400
#define USE_SINGLE_CCODE_FILE
#endif
const char *desc;
} modes[] = {
{ "files", 0, "Uses raw data files (no effect). Installation copies all files to the target location." },
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
{ "dll", "library", "Generates one common data file and one shared library, <package>.dll"},
{ "common", "archive", "Generates just the common file, <package>.dat"},
{ "static", "static", "Generates one statically linked library, " LIB_PREFIX "<package>" UDATA_LIB_SUFFIX }
LIB_FILE_VERSION_MAJOR,
LIB_FILE_VERSION,
LIB_FILE_VERSION_TMP,
-#ifdef U_CYGWIN
+#if U_PLATFORM == U_PF_CYGWIN
LIB_FILE_CYGWIN,
LIB_FILE_CYGWIN_VERSION,
#endif
}
if (!specialHandling) {
-#if defined(USING_CYGWIN) || defined(OS400)
+#if defined(USING_CYGWIN) || U_PLATFORM == U_PF_OS400
if ((len + BUFFER_PADDING_SIZE) >= SMALL_BUFFER_MAX_SIZE) {
cmd = (char *)uprv_malloc(len + BUFFER_PADDING_SIZE);
} else {
#ifdef USING_CYGWIN
sprintf(cmd, "bash -c \"%s\"", command);
-#elif defined(OS400)
+#elif U_PLATFORM == U_PF_OS400
sprintf(cmd, "QSH CMD('%s')", command);
#endif
#else
}
}
-#ifndef OS400
+#if U_PLATFORM != U_PF_OS400
/* Certain platforms have different library extension ordering. (e.g. libicudata.##.so vs libicudata.so.##)
* reverseExt is FALSE if the suffix should be the version number.
*/
}
#ifdef CAN_WRITE_OBJ_CODE
writeObjectCode(datFileNamePath, o->tmpDir, o->entryName, NULL, NULL, gencFilePath);
-#ifdef U_LINUX
+#if U_PLATFORM_IS_LINUX_BASED
result = pkg_generateLibraryFile(targetDir, mode, gencFilePath);
#elif defined(WINDOWS_WITH_MSVC)
result = pkg_createWindowsDLL(mode, gencFilePath, o);
return result;
}
}
-#ifndef U_WINDOWS
+#if !U_PLATFORM_USES_ONLY_WIN32_API
if(mode != MODE_STATIC) {
/* Certain platforms uses archive library. (e.g. AIX) */
if(o->verbose) {
fprintf(stderr, "Error creating data archive library file.\n");
return result;
}
-#ifndef OS400
+#if U_PLATFORM != U_PF_OS400
/* Create symbolic links for the final library file. */
result = pkg_createSymLinks(targetDir);
if (result != 0) {
} /* !MODE_STATIC */
#endif
-#if !defined(U_WINDOWS) || defined(USING_CYGWIN)
+#if !U_PLATFORM_USES_ONLY_WIN32_API
/* Install the libraries if option was set. */
if (o->install != NULL) {
if(o->verbose) {
}
if (version != NULL) {
-#if defined(U_CYGWIN)
+#if U_PLATFORM == U_PF_CYGWIN
sprintf(libFileNames[LIB_FILE_CYGWIN], "cyg%s.%s",
libName,
pkgDataFlags[SO_EXT]);
uprv_strcat(pkgDataFlags[SO_EXT], ".");
uprv_strcat(pkgDataFlags[SO_EXT], pkgDataFlags[A_EXT]);
-#elif defined(OS400) || defined(_AIX)
+#elif U_PLATFORM == U_PF_OS400 || defined(_AIX)
sprintf(libFileNames[LIB_FILE_VERSION_TMP], "%s.%s",
libFileNames[LIB_FILE],
pkgDataFlags[SOBJ_EXT]);
fprintf(stdout, "# libFileName[LIB_FILE_VERSION] = %s\n", libFileNames[LIB_FILE_VERSION]);
}
-#if defined(U_CYGWIN) || defined(U_MINGW)
+#if U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
/* 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)
+#if U_PLATFORM == U_PF_MINGW
/* On MINGW, symbolic links don't need to be created. */
return result;
#endif
#endif
if (specialHandling) {
-#ifdef U_CYGWIN
+#if U_PLATFORM == U_PF_CYGWIN
sprintf(name1, "%s", libFileNames[LIB_FILE_CYGWIN]);
sprintf(name2, "%s", libFileNames[LIB_FILE_CYGWIN_VERSION]);
#else
fprintf(stderr, "Error installing library. Failed command: %s\n", cmd);
return result;
}
-#elif defined(U_CYGWIN)
+#elif U_PLATFORM == U_PF_CYGWIN
sprintf(cmd, "cd %s && %s %s %s",
targetDir,
pkgDataFlags[INSTALL_CMD],
uprv_strlen(objectFile) + uprv_strlen(pkgDataFlags[LD_SONAME]) +
uprv_strlen(pkgDataFlags[LD_SONAME][0] == 0 ? "" : libFileNames[LIB_FILE_VERSION_MAJOR]) +
uprv_strlen(pkgDataFlags[RPATH_FLAGS]) + uprv_strlen(pkgDataFlags[BIR_FLAGS]) + BUFFER_PADDING_SIZE;
-#ifdef U_CYGWIN
+#if U_PLATFORM == U_PF_CYGWIN
length += uprv_strlen(targetDir) + uprv_strlen(libFileNames[LIB_FILE_CYGWIN_VERSION]);
#endif
if ((cmd = (char *)uprv_malloc(sizeof(char) * length)) == NULL) {
}
freeCmd = TRUE;
}
-#if defined(U_CYGWIN)
+#if U_PLATFORM == U_PF_CYGWIN
sprintf(cmd, "%s%s%s %s -o %s%s %s %s%s %s %s",
pkgDataFlags[GENLIB],
targetDir,
libFileNames[LIB_FILE_VERSION_TMP],
pkgDataFlags[LDICUDTFLAGS],
targetDir, libFileNames[LIB_FILE_CYGWIN_VERSION],
-#elif defined(U_AIX)
+#elif U_PLATFORM == U_PF_AIX
sprintf(cmd, "%s %s%s;%s %s -o %s%s %s %s%s %s %s",
RM_CMD,
targetDir,
#endif
static UPKGOptions *pkg_checkFlag(UPKGOptions *o) {
-#ifdef U_AIX
+#if U_PLATFORM == U_PF_AIX
/* AIX needs a map file. */
char *flag = NULL;
int32_t length = 0;
T_FileStream_close(f);
}
}
-#elif defined(U_CYGWIN)
+#elif U_PLATFORM == U_PF_CYGWIN
/* Cygwin needs to change flag options. */
char *flag = NULL;
int32_t length = 0;
}
uprv_memset(flag + position, 0, length - position);
-#elif defined(OS400)
- /* OS400 needs to fix the ld options (swap single quote with double quote) */
+#elif U_PLATFORM == U_PF_OS400
+ /* OS/400 needs to fix the ld options (swap single quote with double quote) */
char *flag = NULL;
int32_t length = 0;
/**************************************************************************
*
-* Copyright (C) 2000-2009, International Business Machines
+* Copyright (C) 2000-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
***************************************************************************
/* set up common defines for library naming */
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
# ifndef UDATA_SO_SUFFIX
# define UDATA_SO_SUFFIX ".dll"
# endif
# define OBJ_SUFFIX ".obj"
# define UDATA_LIB_SUFFIX ".lib"
-#elif defined(U_CYGWIN)
+#elif U_PLATFORM == U_PF_CYGWIN
# define LIB_PREFIX "cyg"
# define LIB_STATIC_PREFIX "lib"
# define OBJ_SUFFIX ".o"
CFLAGS += $(LIBCFLAGS)
CXXFLAGS += $(LIBCXXFLAGS)
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n $(LIBCPPFLAGS)
DEFS += -DU_TOOLUTIL_IMPLEMENTATION
LDFLAGS += $(LDFLAGSICUTOOLUTIL)
/*
******************************************************************************
*
-* Copyright (C) 1997-2005, International Business Machines
+* Copyright (C) 1997-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
T_FileStream_wopen(const wchar_t* filename, const wchar_t* mode)
{
// TBD: _wfopen is believed to be MS-specific?
-#if defined(U_WINDOWS)
+#if U_PLATFORM_USES_ONLY_WIN32_API
FILE* result = _wfopen(filename, mode);
return (FileStream*)result;
#else
/******************************************************************************
- * Copyright (C) 2009-2010, International Business Machines
+ * Copyright (C) 2009-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
# define VC_EXTRALEAN
# define WIN32_LEAN_AND_MEAN
# define NOUSER
# endif
#endif
-#ifdef U_LINUX
+#if U_PLATFORM_IS_LINUX_BASED
# define U_ELF
#endif
#define HEX_0X 0 /* 0x1234 */
#define HEX_0H 1 /* 01234h */
-#if defined(U_WINDOWS) || defined(U_ELF)
+#if U_PLATFORM_HAS_WIN32_API || defined(U_ELF)
#define CAN_GENERATE_OBJECTS
#endif
static uint32_t
write32(FileStream *out, uint32_t byte, uint32_t column);
-#ifdef OS400
+#if U_PLATFORM == U_PF_OS400
static uint32_t
write8str(FileStream *out, uint8_t byte, uint32_t column);
#endif
}
}
-#ifdef OS400
+#if U_PLATFORM == U_PF_OS400
/*
TODO: Fix this once the compiler implements this feature. Keep in sync with udatamem.c
return column;
}
-#ifdef OS400
+#if U_PLATFORM == U_PF_OS400
static uint32_t
write8str(FileStream *out, uint8_t byte, uint32_t column) {
char s[8];
#ifdef U_ELF
Elf32_Ehdr header32;
/* Elf32_Ehdr and ELF64_Ehdr are identical for the necessary fields. */
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
IMAGE_FILE_HEADER header;
#endif
} buffer;
#ifdef U_ELF
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
const IMAGE_FILE_HEADER *pHeader;
#else
# error "Unknown platform for CAN_GENERATE_OBJECTS."
*pCPU=EM_386;
*pBits=32;
*pIsBigEndian=(UBool)(U_IS_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB);
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
/* _M_IA64 should be defined in windows.h */
# if defined(_M_IA64)
*pCPU=IMAGE_FILE_MACHINE_IA64;
/* TODO: Support byte swapping */
*pCPU=buffer.header32.e_machine;
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
if(length<sizeof(IMAGE_FILE_HEADER)) {
fprintf(stderr, "genccode: match-arch file %s is too short\n", filename);
exit(U_UNSUPPORTED_ERROR);
newSuffix=".o";
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
struct {
IMAGE_FILE_HEADER fileHeader;
IMAGE_SECTION_HEADER sections[2];
/* deal with options, files and the entry point name */
getArchitecture(&cpu, &bits, &makeBigEndian, optMatchArch);
printf("genccode: --match-arch cpu=%hu bits=%hu big-endian=%hu\n", cpu, bits, makeBigEndian);
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
if(cpu==IMAGE_FILE_MACHINE_I386) {
entryOffset=1;
}
if(paddingSize!=0) {
T_FileStream_write(out, padding, paddingSize);
}
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
/* populate the .obj headers */
uprv_memset(&objHeader, 0, sizeof(objHeader));
uprv_memset(&symbols, 0, sizeof(symbols));
T_FileStream_write(out, buffer, (int32_t)length);
}
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
/* write the symbol table */
T_FileStream_write(out, symbols, IMAGE_SIZEOF_SYMBOL);
T_FileStream_write(out, &symbolNames, symbolNames.sizeofLongNames);
/*
**********************************************************************
-* Copyright (c) 2009, International Business Machines
+* Copyright (c) 2009-2011, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*/
* -AIX/VACPP
* -Solaris/GCC
*/
-#if (defined(U_AIX) && !defined(__GNUC__)) || (defined(U_SOLARIS) && defined(__GNUC__))
+#if (U_PLATFORM == U_PF_AIX && !defined(__GNUC__)) || (U_PLATFORM == U_PF_SOLARIS && defined(__GNUC__))
# if _XOPEN_SOURCE_EXTENDED && !defined(U_HAVE_STD_STRING)
# define U_HAVE_STD_STRING 0
# endif
#include <sys/stat.h>
#include "unicode/utypes.h"
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
# define VC_EXTRALEAN
# define WIN32_LEAN_AND_MEAN
# define NOUSER
#endif
/* In MinGW environment, io.h needs to be included for _mkdir() */
-#ifdef U_MINGW
+#if U_PLATFORM == U_PF_MINGW
#include <io.h>
#endif
U_CAPI const char * U_EXPORT2
getLongPathname(const char *pathname) {
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
/* anticipate problems with "short" pathnames */
static WIN32_FIND_DATAA info;
HANDLE file=FindFirstFileA(pathname, &info);
uprv_mkdir(const char *pathname, UErrorCode *status) {
int retVal = 0;
-#if defined(U_WINDOWS) || defined(U_MINGW)
+#if U_PLATFORM_USES_ONLY_WIN32_API
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) || defined(U_MINGW)
+#if U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_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;
/*
*******************************************************************************
*
-* Copyright (C) 1999-2010, International Business Machines
+* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
#include "unicode/utypes.h"
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
#include "unicode/errorcode.h"
/*
*******************************************************************************
*
-* Copyright (C) 2000, International Business Machines
+* Copyright (C) 2000-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
#include "unicode/utypes.h"
/* This should usually be called before calling u_parseArgs */
-/*#if defined(OS390) && (U_CHARSET_FAMILY == U_ASCII_FAMILY)*/
+/*#if U_PLATFORM == U_PF_OS390 && (U_CHARSET_FAMILY == U_ASCII_FAMILY)*/
/* translate args from EBCDIC to ASCII */
/*# define U_MAIN_INIT_ARGS(argc, argv) __argvtoascii_a(argc, argv)*/
/*#elif defined(XP_MAC_CONSOLE)*/