ICU-8452 un-autoconf platform.h, move user-configurable settings to uconfig.h, and other changes; from svn merge --reintegrate branches/markus/platformh at r30411

X-SVN-Rev: 30412
This commit is contained in:
Markus Scherer 2011-07-23 00:10:30 +00:00
parent e258161603
commit 9bcc40cf9e
155 changed files with 1708 additions and 1954 deletions

View File

@ -43,6 +43,8 @@
<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>
@ -230,6 +232,28 @@
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>
@ -662,6 +686,22 @@
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>

View File

@ -57,12 +57,9 @@ DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
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
@ -132,7 +129,7 @@ distclean : distclean-local
dist: dist-local
check: all check-local
all-local: $(ALL_TARGETS) unicode/platform.h
all-local: $(ALL_TARGETS)
install-local: install-headers install-library
@ -182,7 +179,7 @@ clean-local:
$(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:
@ -190,10 +187,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(SVC_HOOK_INC)
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)$@ $^

View File

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (c) 2001-2010, International Business Machines
* Copyright (c) 2001-2011, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
@ -21,7 +21,7 @@ U_NAMESPACE_BEGIN
// 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

View File

@ -107,7 +107,7 @@ typedef void U_CALLCONV UObjectDeleter(void* obj);
U_CAPI void U_EXPORT2
uprv_deleteUObject(void *obj);
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
U_NAMESPACE_BEGIN
@ -549,5 +549,5 @@ inline H *MaybeStackHeaderAndArray<H, T, stackCapacity>::orphanOrClone(int32_t l
U_NAMESPACE_END
#endif /* XP_CPLUSPLUS */
#endif /* __cplusplus */
#endif /* CMEMORY_H */

View File

@ -625,6 +625,34 @@
</CustomBuild>
<ClInclude Include="locmap.h" />
<ClInclude Include="mutex.h" />
<CustomBuild Include="unicode\platform.h">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">copy "%(FullPath)" ..\..\include\unicode
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy "%(FullPath)" ..\..\include\unicode
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">copy "%(FullPath)" ..\..\include\unicode
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="unicode\ptypes.h">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">copy "%(FullPath)" ..\..\include\unicode
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy "%(FullPath)" ..\..\include\unicode
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">copy "%(FullPath)" ..\..\include\unicode
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="unicode\putil.h">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode
</Command>
@ -640,20 +668,6 @@
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
</CustomBuild>
<ClInclude Include="putilimp.h" />
<CustomBuild Include="unicode\pwin32.h">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">copy "%(FullPath)" ..\..\include\unicode
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy "%(FullPath)" ..\..\include\unicode
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">copy "%(FullPath)" ..\..\include\unicode
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="unicode\std_string.h">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode
</Command>
@ -1737,23 +1751,6 @@
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="unicode\platform.win">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" unicode\%(FileName).h
copy "%(FullPath)" ..\..\include\unicode\%(FileName).h</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">unicode\%(Filename).h;..\..\include\unicode\%(Filename).h;%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">copy "%(FullPath)" unicode\%(FileName).h
copy "%(FullPath)" ..\..\include\unicode\%(FileName).h</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">unicode\%(Filename).h;..\..\include\unicode\%(Filename).h;%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy "%(FullPath)" unicode\%(FileName).h
copy "%(FullPath)" ..\..\include\unicode\%(FileName).h</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">unicode\%(Filename).h;..\..\include\unicode\%(Filename).h;%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">copy "%(FullPath)" unicode\%(FileName).h
copy "%(FullPath)" ..\..\include\unicode\%(FileName).h</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">unicode\%(Filename).h;..\..\include\unicode\%(Filename).h;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@ -817,15 +817,15 @@
<CustomBuild Include="unicode\icudataver.h">
<Filter>configuration</Filter>
</CustomBuild>
<CustomBuild Include="unicode\platform.win">
<CustomBuild Include="unicode\platform.h">
<Filter>configuration</Filter>
</CustomBuild>
<CustomBuild Include="unicode\ptypes.h">
<Filter>configuration</Filter>
</CustomBuild>
<CustomBuild Include="unicode\putil.h">
<Filter>configuration</Filter>
</CustomBuild>
<CustomBuild Include="unicode\pwin32.h">
<Filter>configuration</Filter>
</CustomBuild>
<CustomBuild Include="unicode\std_string.h">
<Filter>configuration</Filter>
</CustomBuild>

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 1997-2005, International Business Machines
* Copyright (C) 1997-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -62,7 +62,7 @@ uprv_ebcdictolower(char c);
#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)

View File

@ -30,7 +30,15 @@
#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

View File

@ -77,7 +77,12 @@ Cleanly installed Solaris can use this #define.
#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
@ -86,13 +91,13 @@ Cleanly installed Solaris can use this #define.
# 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>
@ -100,20 +105,20 @@ Cleanly installed Solaris can use this #define.
# 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
@ -123,11 +128,7 @@ Cleanly installed Solaris can use this #define.
*/
#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
@ -146,7 +147,15 @@ Cleanly installed Solaris can use this #define.
* 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]))
@ -178,7 +187,7 @@ static const BitPatternConversion gInf = { (int64_t) INT64_C(0x7FF0000000000000)
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
@ -264,7 +273,7 @@ static UDate getUTCtime_fake() {
}
#endif
#if defined(U_WINDOWS)
#if U_PLATFORM_USES_ONLY_WIN32_API
typedef union {
int64_t int64;
FILETIME fileTime;
@ -297,7 +306,7 @@ uprv_getUTCtime()
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;
@ -311,7 +320,7 @@ uprv_getRawUTCtime()
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);
@ -350,7 +359,7 @@ uprv_isNaN(double number)
/* 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,
@ -375,7 +384,7 @@ uprv_isInfinite(double 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,
@ -394,7 +403,7 @@ uprv_isInfinite(double 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);
@ -404,7 +413,7 @@ uprv_isPositiveInfinity(double 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
@ -418,7 +427,7 @@ uprv_isNegativeInfinity(double number)
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,*/
@ -431,7 +440,7 @@ uprv_getNaN()
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*/
@ -573,7 +582,7 @@ uprv_log(double d)
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
@ -651,15 +660,15 @@ uprv_timezone()
/* 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
@ -679,7 +688,7 @@ static char gTimeZoneBuffer[PATH_MAX];
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;
@ -722,7 +731,7 @@ static void skipZoneIDPrefix(const char** id) {
}
#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 {
@ -969,7 +978,7 @@ U_CAPI const char* U_EXPORT2
uprv_tzname(int n)
{
const char *tzid = NULL;
#ifdef U_WINDOWS
#if U_PLATFORM_USES_ONLY_WIN32_API
tzid = uprv_detectWindowsTimeZone();
if (tzid != NULL) {
@ -977,7 +986,7 @@ uprv_tzname(int n)
}
#else
/*#if defined(U_DARWIN)
/*#if U_PLATFORM_IS_DARWIN_BASED
int ret;
tzid = getenv("TZFILE");
@ -1050,7 +1059,7 @@ uprv_tzname(int n)
#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]);
@ -1169,7 +1178,7 @@ uprv_pathIsAbsolute(const char *path)
}
#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] == ':' ) {
@ -1182,7 +1191,7 @@ uprv_pathIsAbsolute(const char *path)
/* 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
@ -1260,7 +1269,7 @@ u_getDataDirectory(void) {
/* Macintosh-specific locale information ------------------------------------ */
#ifdef XP_MAC
#if U_PLATFORM == U_PF_CLASSIC_MACOS
typedef struct {
int32_t script;
@ -1570,7 +1579,7 @@ The leftmost codepage (.xxx) wins.
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);
@ -1580,7 +1589,7 @@ The leftmost codepage (.xxx) wins.
}
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;
@ -1615,7 +1624,7 @@ The leftmost codepage (.xxx) wins.
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");
@ -1728,7 +1737,7 @@ remapPlatformDependentCodepage(const char *locale, const char *name) {
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";
@ -1737,7 +1746,7 @@ remapPlatformDependentCodepage(const char *locale, const char *name) {
/* 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) {
@ -1764,7 +1773,7 @@ remapPlatformDependentCodepage(const char *locale, const char *name) {
*/
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.
@ -1783,12 +1792,12 @@ remapPlatformDependentCodepage(const char *locale, const char *name) {
*/
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! */
@ -1802,7 +1811,7 @@ remapPlatformDependentCodepage(const char *locale, const char *name) {
*/
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) {
@ -1866,7 +1875,7 @@ getCodepageFromPOSIXID(const char *localeName, char * buffer, int32_t buffCapaci
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;
@ -1887,7 +1896,7 @@ int_getDefaultCodepage()
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));
@ -1896,10 +1905,10 @@ int_getDefaultCodepage()
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;
@ -1917,7 +1926,7 @@ int_getDefaultCodepage()
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.
@ -2086,9 +2095,10 @@ u_getVersion(UVersionInfo versionArray) {
#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
@ -2163,7 +2173,7 @@ uprv_dlsym_func(void *lib, const char* sym, UErrorCode *status) {
#endif
#elif defined U_WINDOWS
#elif U_PLATFORM_HAS_WIN32_API
U_INTERNAL void * U_EXPORT2
uprv_dl_open(const char *libName, UErrorCode *status) {

View File

@ -259,10 +259,10 @@ U_INTERNAL void * U_EXPORT2 uprv_maximumPtr(void *base);
* @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
/*

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 1999-2005,2008 International Business Machines
* Copyright (C) 1999-2011 International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -45,7 +45,7 @@ ubrk_swap(const UDataSwapper *ds,
const void *inData, int32_t length, void *outData,
UErrorCode *pErrorCode);
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
#include "unicode/uobject.h"
#include "unicode/unistr.h"

View File

@ -32,8 +32,7 @@
* 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)
*/
@ -109,17 +108,9 @@ U_CAPI void U_EXPORT2 UCLN_FINI ()
/* 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.
*/
@ -168,6 +159,16 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
}
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 */

View File

@ -1274,7 +1274,7 @@ ucnv_getDefaultName() {
#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";

View File

@ -14,9 +14,9 @@
* 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

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 1999-2010, International Business Machines
* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************/
@ -60,7 +60,7 @@ UDataMemory_normalizeDataPointer(const void *p) {
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

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 1999-2010, International Business Machines
* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************/
@ -59,10 +59,6 @@
# 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>
@ -181,7 +177,7 @@
}
/* 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);
@ -194,7 +190,7 @@
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;

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 1999-2010, International Business Machines
* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************/
@ -38,10 +38,10 @@ U_CFUNC void uprv_unmapFile(UDataMemory *pData);
#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

View File

@ -27,17 +27,13 @@
* 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)
@ -45,7 +41,7 @@
#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
@ -100,7 +96,7 @@
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)
@ -493,18 +489,21 @@ umtx_atomic_inc(int32_t *p) {
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
}
@ -517,18 +516,21 @@ umtx_atomic_dec(int32_t *p) {
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
}

View File

@ -21,11 +21,11 @@
#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
@ -49,30 +49,15 @@
# 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 \

View File

@ -0,0 +1,828 @@
/*
******************************************************************************
*
* 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 (19842001) @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 &lt;iostream&gt; 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 &lt;iostream.h&gt; 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) &lt;string&gt; 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 " % &amp; ' ( ) * + , - . / : ; < = > ? _
* \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 32bit in the 64bit environment and
* 16bit in the 32bit 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

View File

@ -1,393 +0,0 @@
/*
******************************************************************************
*
* 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 &lt;iostream&gt; 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 &lt;iostream.h&gt; 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) &lt;string&gt; 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

View File

@ -1,25 +0,0 @@
/*
******************************************************************************
*
* 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

View File

@ -1,260 +0,0 @@
/*
******************************************************************************
*
* 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

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 1997-2010, International Business Machines
* Copyright (C) 1997-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -28,29 +28,37 @@
/* 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 */
#include <inttypes.h>
#elif U_HAVE_INTTYPES_H
#else /* U_HAVE_INTTYPES_H */
# include <inttypes.h>
#else /* neither U_HAVE_STDINT_H nor U_HAVE_INTTYPES_H */
#if ! U_HAVE_INT8_T
typedef signed char int8_t;
@ -77,16 +85,21 @@ typedef unsigned int uint32_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 */

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 1997-2009, International Business Machines
* Copyright (C) 1997-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -122,14 +122,14 @@ U_INTERNAL const char* U_EXPORT2 uprv_getDefaultLocaleID(void);
* 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 ';'

View File

@ -1,350 +0,0 @@
/*
******************************************************************************
*
* 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 &lt;iostream&gt; 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 &lt;iostream.h&gt; 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
/** @} */

View File

@ -25,15 +25,6 @@
#include "unicode/utypes.h"
/**
* \def U_HAVE_STD_STRING
* Define whether the standard C++ (STL) &lt;string&gt; header is available.
* @internal
*/
#ifndef U_HAVE_STD_STRING
#define U_HAVE_STD_STRING 1
#endif
#if U_HAVE_STD_STRING
#include <string>

View File

@ -18,9 +18,17 @@
/*!
* \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.
@ -38,14 +46,177 @@
/**
* 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.

View File

@ -41,22 +41,7 @@
/* 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:
@ -64,19 +49,6 @@
*/
#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++. */
@ -101,7 +73,7 @@
* @stable ICU 2.4
*/
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
# define U_CFUNC extern "C"
# define U_CDECL_BEGIN extern "C" {
# define U_CDECL_END }
@ -124,7 +96,7 @@
* 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
@ -243,27 +215,6 @@ typedef int8_t UBool;
/* 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.
@ -284,14 +235,16 @@ typedef int8_t UBool;
# 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
@ -303,9 +256,10 @@ typedef int8_t UBool;
/**
* \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.
@ -313,14 +267,13 @@ typedef int8_t UBool;
* @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
@ -344,27 +297,6 @@ typedef int8_t UBool;
*/
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

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 2002-2010, International Business Machines
* Copyright (C) 2002-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -19,50 +19,11 @@
#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
@ -76,13 +37,66 @@ U_NAMESPACE_BEGIN
* 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).

View File

@ -54,7 +54,7 @@
* \def U_SHOW_CPLUSPLUS_API
* @internal
*/
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
# ifndef U_SHOW_CPLUSPLUS_API
# define U_SHOW_CPLUSPLUS_API 1
# endif
@ -104,94 +104,6 @@
/** @} */
/*===========================================================================*/
/* 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 " % &amp; ' ( ) * + , - . / : ; < = > ? _
* \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 */
/*===========================================================================*/
@ -270,30 +182,13 @@
#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)
@ -334,56 +229,6 @@ typedef double UDate;
*/
#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 */
/*===========================================================================*/
@ -560,9 +405,9 @@ typedef void* UClassID;
*
* 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
/**
@ -847,7 +692,7 @@ typedef enum UErrorCode {
/* 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

View File

@ -104,7 +104,7 @@ typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH];
*/
/* 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 { }

View File

@ -412,7 +412,7 @@ uchar_swapNames(const UDataSwapper *ds,
const void *inData, int32_t length, void *outData,
UErrorCode *pErrorCode);
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
U_NAMESPACE_BEGIN

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 2001-2010, International Business Machines
* Copyright (C) 2001-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -618,7 +618,7 @@ U_CDECL_END
/* C++ convenience wrappers ------------------------------------------------- */
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
#include "mutex.h"

View File

@ -11,7 +11,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#include "wintz.h"
@ -287,4 +287,4 @@ uprv_detectWindowsTimeZone() {
return icuid;
}
#endif /* #ifdef U_WINDOWS */
#endif /* U_PLATFORM_HAS_WIN32_API */

View File

@ -1,6 +1,6 @@
/*
********************************************************************************
* Copyright (C) 2005-2008, International Business Machines
* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
@ -14,7 +14,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
/**
* \file
@ -29,6 +29,6 @@ U_CDECL_END
U_CFUNC const char* U_EXPORT2
uprv_detectWindowsTimeZone();
#endif /* #ifdef U_WINDOWS */
#endif /* U_PLATFORM_HAS_WIN32_API */
#endif /* __WINTZ */

View File

@ -7839,7 +7839,7 @@ then
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
@ -8596,7 +8596,6 @@ do
"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

View File

@ -1418,8 +1418,7 @@ AC_CONFIG_FILES([icudefs.mk \
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

View File

@ -1,5 +1,5 @@
## 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
@ -23,7 +23,7 @@ CLEANFILES = *~ $(DEPS)
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@

View File

@ -42,7 +42,7 @@ CLEANFILES = *~ $(DEPS) $(ALL_MAN_FILES)
## 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),)

View File

@ -40,10 +40,10 @@
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
@ -1134,7 +1134,7 @@ main(int argc, char **argv)
// 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, '/');
}

View File

@ -53,9 +53,6 @@ DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
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)

View File

@ -344,7 +344,7 @@ DateFormat* U_EXPORT2
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);

View File

@ -61,7 +61,7 @@ class CharString;
// 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

View File

@ -66,9 +66,8 @@ struct UResourceBundleAIterator {
/* 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;
@ -76,6 +75,7 @@ ures_a_codepointSort(const void *context, const void *left, const void *right) {
((const UResAEntry *)right)->key);
}
U_CDECL_END
static void ures_a_open(UResourceBundleAIterator *aiter, UResourceBundle *bund, UErrorCode *status) {
if(U_FAILURE(*status)) {

View File

@ -1110,7 +1110,7 @@ NumberFormat::makeInstance(const Locale& desiredLocale,
return NULL;
}
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
char buffer[8];
int32_t count = desiredLocale.getKeywordValue("compat", buffer, sizeof(buffer), status);

View File

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (C) 1999-2007, International Business Machines Corporation
* Copyright (C) 1999-2011, International Business Machines Corporation
* and others. All Rights Reserved.
**********************************************************************
* Date Name Description
@ -13,7 +13,7 @@
#include "unicode/utypes.h"
#if !UCONFIG_NO_TRANSLITERATION
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
#include "unicode/uobject.h"
#include "unicode/parseerr.h"
@ -335,7 +335,7 @@ private:
U_NAMESPACE_END
#endif /* #ifdef XP_CPLUSPLUS */
#endif /* #ifdef __cplusplus */
/**
* Strip/convert the following from the transliterator rules:

View File

@ -493,7 +493,7 @@ TimeZone::initDefault()
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

View File

@ -41,7 +41,7 @@
#if !UCONFIG_NO_COLLATION
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
#include "unicode/normalizer2.h"
#include "unicode/unistr.h"
#endif
@ -281,7 +281,7 @@ minimum number for special Jamo
#define NFC_ZERO_CC_BLOCK_LIMIT_ 0x300
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
U_NAMESPACE_BEGIN
@ -364,7 +364,7 @@ uprv_delete_collIterate(U_NAMESPACE_QUALIFIER collIterate *s);
U_CAPI UBool U_EXPORT2
uprv_collIterateAtEnd(U_NAMESPACE_QUALIFIER collIterate *s);
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
U_NAMESPACE_BEGIN
@ -548,7 +548,7 @@ U_CFUNC uint32_t U_EXPORT2 ucol_getPrevCE(const UCollator *coll,
/* get some memory */
void *ucol_getABuffer(const UCollator *coll, uint32_t size);
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
U_NAMESPACE_BEGIN
@ -1085,7 +1085,7 @@ ucol_getLeadBytesForReorderCode(const UCollator *uca, int reorderCode, uint16_t*
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
@ -1114,7 +1114,7 @@ static inline UBool ucol_unsafeCP(UChar c, const UCollator *coll) {
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);

View File

@ -22,7 +22,7 @@
#if !UCONFIG_NO_NORMALIZATION
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
U_NAMESPACE_BEGIN
@ -390,7 +390,7 @@ struct SpoofDataHeader {
U_NAMESPACE_END
#endif /* XP_CPLUSPLUS */
#endif /* __cplusplus */
/**
* Endianness swap function for binary spoof data.

View File

@ -1,6 +1,6 @@
/*
********************************************************************************
* Copyright (C) 2005-2009, International Business Machines
* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
@ -11,7 +11,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
@ -317,5 +317,5 @@ U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif // #ifdef U_WINDOWS
#endif // U_PLATFORM_HAS_WIN32_API

View File

@ -14,7 +14,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
@ -135,6 +135,6 @@ U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif // #ifdef U_WINDOWS
#endif // U_PLATFORM_HAS_WIN32_API
#endif // __WINDTFMT

View File

@ -1,6 +1,6 @@
/*
********************************************************************************
* Copyright (C) 2005-2007, International Business Machines
* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
@ -11,7 +11,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
@ -351,4 +351,4 @@ U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif // #ifdef U_WINDOWS
#endif // U_PLATFORM_HAS_WIN32_API

View File

@ -14,7 +14,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#include "unicode/format.h"
#include "unicode/datefmt.h"
@ -156,6 +156,6 @@ U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif // #ifdef U_WINDOWS
#endif // U_PLATFORM_HAS_WIN32_API
#endif // __WINNMFMT

View File

@ -1,6 +1,6 @@
/*
********************************************************************************
* Copyright (C) 2009, International Business Machines
* Copyright (C) 2009-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
@ -11,7 +11,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#include "wintzimpl.h"

View File

@ -1,6 +1,6 @@
/*
********************************************************************************
* Copyright (C) 2008, International Business Machines
* Copyright (C) 2008-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
@ -14,7 +14,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
/**
* \file
* \brief C API: Utilities for dealing w/ Windows time zones.
@ -32,6 +32,6 @@ U_CAPI UBool U_EXPORT2
uprv_getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const UChar *icuid, int32_t length);
#endif /* #ifdef U_WINDOWS */
#endif /* U_PLATFORM_HAS_WIN32_API */
#endif /* __WINTZIMPL */

View File

@ -1,6 +1,6 @@
#******************************************************************************
#
# Copyright (C) 1999-2009, International Business Machines
# Copyright (C) 1999-2011, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
@ -53,9 +53,6 @@ DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
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)

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 1998-2010, International Business Machines
* Copyright (C) 1998-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -37,7 +37,7 @@
#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
@ -62,7 +62,7 @@ finit_owner(FILE *f,
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

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 1998-2010, International Business Machines
* Copyright (C) 1998-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -37,7 +37,7 @@
#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. */

View File

@ -1,6 +1,6 @@
/*
*
* (C) Copyright IBM Corp. 1998-2009 - All Rights Reserved
* (C) Copyright IBM Corp. 1998-2011 - All Rights Reserved
*
*/
@ -13,7 +13,7 @@
#include "unicode/utypes.h"
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
#include "unicode/uobject.h"
#endif
@ -258,7 +258,7 @@ struct LEPoint
float fY;
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
/**
* Used to hold a pair of (x, y) values which represent a point.
*
@ -542,7 +542,7 @@ enum LEErrorCode {
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.
*

View File

@ -1,6 +1,6 @@
#******************************************************************************
#
# Copyright (C) 1999-2007, International Business Machines
# Copyright (C) 1999-2011, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
@ -52,9 +52,6 @@ DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
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)

View File

@ -1,6 +1,6 @@
#******************************************************************************
#
# Copyright (C) 1999-2008, International Business Machines
# Copyright (C) 1999-2011, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
@ -52,9 +52,6 @@ DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
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)

View File

@ -1,5 +1,5 @@
## 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
@ -20,7 +20,7 @@ CLEANFILES = *~ $(DEPS)
## 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

View File

@ -1,5 +1,5 @@
## 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
@ -20,7 +20,7 @@ CLEANFILES = *~ $(DEPS)
## 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

View File

@ -1,5 +1,5 @@
## 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
@ -23,7 +23,7 @@ CLEANFILES = *~ $(DEPS)
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`

View File

@ -1,6 +1,6 @@
#******************************************************************************
#
# Copyright (C) 1999-2007, International Business Machines
# Copyright (C) 1999-2011, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
@ -43,9 +43,6 @@ DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
ifneq ($(top_builddir),$(top_srcdir))
CPPFLAGS += -I$(top_builddir)/common
endif
CPPFLAGS += -I$(top_srcdir)/common $(LIBCPPFLAGS)
LDFLAGS += $(LDFLAGSICUDT)
@ -119,10 +116,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
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)$@ $^

View File

@ -32,9 +32,6 @@ BUILDDIR := $(BUILDDIR:test\\cintltst/../../=)
# 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)"'

View File

@ -1,6 +1,6 @@
/********************************************************************
* 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
@ -19,7 +19,7 @@
#include "unicode/uchar.h"
#include "unicode/ubidi.h"
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
extern "C" {
#endif
@ -75,7 +75,7 @@ tests[];
extern const int
bidiTestCount;
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
}
#endif

View File

@ -28,7 +28,7 @@
#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)

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2010, International Business Machines Corporation and
* Copyright (c) 1997-2011, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
@ -494,7 +494,7 @@ char *aescstrdup(const UChar* unichars,int32_t length){
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";

View File

@ -662,7 +662,7 @@ static UCollationResult ucaTest(void *collator, const int object, const UChar *s
/*
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

View File

@ -219,7 +219,7 @@ static void MessageFormatTest( void )
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__);

View File

@ -196,7 +196,7 @@ static void TestExponential(void)
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 };
@ -220,7 +220,7 @@ static void TestExponential(void)
};
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,

View File

@ -34,7 +34,7 @@
#include <stdlib.h>
#include <stdio.h>
#ifdef U_WINDOWS
#if U_PLATFORM_USES_ONLY_WIN32_API
#include <io.h>
#else
#include <unistd.h>
@ -1151,7 +1151,7 @@ static void TestICUDataName()
/* 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;

View File

@ -1,5 +1,5 @@
## 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
@ -20,7 +20,7 @@ CLEANFILES = *~ $(DEPS)
## 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

View File

@ -1,3 +1,3 @@
# 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

View File

@ -32,9 +32,6 @@ BUILDDIR := $(BUILDDIR:test\\intltest/../../=)
# 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)

View File

@ -21,7 +21,7 @@
#include "caltest.h" // for fieldName
#include <stdio.h> // for sprintf
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#include "windttst.h"
#endif
@ -2098,7 +2098,7 @@ void DateFormatTest::TestZTimeZoneParsing(void) {
void DateFormatTest::TestHost(void)
{
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
Win32DateTimeTest::testLocales(this);
#endif
}

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2010, International Business Machines Corporation and
* Copyright (c) 1997-2011, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@ -92,7 +92,7 @@ Int64ToUnicodeString(int64_t num)
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);

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2010, International Business Machines Corporation and
* Copyright (c) 1997-2011, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@ -17,9 +17,9 @@
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

View File

@ -1,6 +1,6 @@
/***********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2010, International Business Machines Corporation
* Copyright (c) 1997-2011, International Business Machines Corporation
* and others. All Rights Reserved.
***********************************************************************/
@ -146,7 +146,7 @@ NumberFormatRoundTripTest::start()
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());
@ -167,10 +167,10 @@ NumberFormatRoundTripTest::test(NumberFormat *fmt)
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:
@ -185,13 +185,13 @@ NumberFormatRoundTripTest::test(NumberFormat *fmt)
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
}
@ -199,8 +199,8 @@ NumberFormatRoundTripTest::test(NumberFormat *fmt)
// 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));

View File

@ -376,7 +376,7 @@ NumberFormatTest::TestExponential(void)
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
@ -2620,7 +2620,7 @@ void NumberFormatTest::TestJB3832(){
void NumberFormatTest::TestHost()
{
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
Win32NumberTest::testLocales(this);
#endif
Locale loc("en_US@compat=host");

View File

@ -1451,7 +1451,7 @@ void NumberFormatRegressionTest::Test4106658(void)
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
@ -1582,7 +1582,7 @@ void NumberFormatRegressionTest::Test4106667(void)
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
@ -1598,7 +1598,7 @@ void NumberFormatRegressionTest::Test4106667(void)
/* @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
@ -2023,7 +2023,7 @@ void NumberFormatRegressionTest::Test4147706(void)
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
@ -2129,7 +2129,7 @@ NumberFormatRegressionTest::Test4162852(void)
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) {

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1999-2009, International Business Machines Corporation and
* Copyright (c) 1999-2011, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@ -28,12 +28,17 @@
#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
@ -44,7 +49,7 @@
/*#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)
@ -62,11 +67,11 @@
#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
@ -130,7 +135,7 @@
#include "unicode/calendar.h"
#include "ucaconf.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#define HAVE_IMP
# define VC_EXTRALEAN
@ -255,7 +260,7 @@ void SimpleThread::sleep(int32_t millis)
// 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
@ -310,7 +315,7 @@ SimpleThread::isRunning() {
// 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
@ -373,7 +378,7 @@ int32_t SimpleThread::start()
#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
@ -417,13 +422,13 @@ SimpleThread::isRunning() {
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);

View File

@ -458,13 +458,13 @@ StringTest::TestStringByteSink() {
#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"));

View File

@ -24,12 +24,18 @@
#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
@ -39,7 +45,7 @@
#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
@ -58,11 +64,11 @@
#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

View File

@ -179,7 +179,7 @@ IntlTestNumberFormat::testFormat(/* char* par */)
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
@ -196,7 +196,7 @@ IntlTestNumberFormat::testFormat(/* char* par */)
// 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
@ -204,7 +204,7 @@ IntlTestNumberFormat::testFormat(/* char* par */)
tryIt(-9.69413034454191e+273);
#endif
#ifndef OS390
#if U_PLATFORM != U_PF_OS390
tryIt(1.234e-200);
tryIt(-2.3e-168);

View File

@ -42,7 +42,7 @@ PUtilTest::testIEEEremainder()
// 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.
@ -343,7 +343,7 @@ PUtilTest::testZero(void)
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.");
}

View File

@ -380,7 +380,7 @@ void UObjectTest::testIDs()
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

View File

@ -1,6 +1,6 @@
/*
********************************************************************************
* Copyright (C) 2005-2009, International Business Machines
* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
@ -11,7 +11,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
@ -193,4 +193,4 @@ void Win32DateTimeTest::testLocales(TestLog *log)
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif /* #ifdef U_WINDOWS */
#endif /* U_PLATFORM_HAS_WIN32_API */

View File

@ -1,6 +1,6 @@
/*
********************************************************************************
* Copyright (C) 2005-2006, International Business Machines
* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
@ -14,7 +14,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
@ -36,6 +36,6 @@ private:
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif // #ifdef U_WINDOWS
#endif // U_PLATFORM_HAS_WIN32_API
#endif // __WINDTTST

View File

@ -1,6 +1,6 @@
/*
********************************************************************************
* Copyright (C) 2005-2009, International Business Machines
* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
@ -11,7 +11,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
@ -320,4 +320,4 @@ void Win32NumberTest::testLocales(TestLog *log)
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif /* #ifdef U_WINDOWS */
#endif /* U_PLATFORM_HAS_WIN32_API */

View File

@ -1,6 +1,6 @@
/*
********************************************************************************
* Copyright (C) 2005-2006, International Business Machines
* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
@ -14,7 +14,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
@ -36,6 +36,6 @@ private:
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif // #ifdef U_WINDOWS
#endif // U_PLATFORM_HAS_WIN32_API
#endif // __WINNMTST

View File

@ -1,6 +1,6 @@
/*
********************************************************************************
* Copyright (C) 2005-2009, International Business Machines
* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
@ -11,7 +11,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
@ -88,4 +88,4 @@ void Win32Utilities::freeLocales(LCIDRecord *records)
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif /* #ifdef U_WINDOWS */
#endif /* U_PLATFORM_HAS_WIN32_API */

View File

@ -1,6 +1,6 @@
/*
********************************************************************************
* Copyright (C) 2005-2009, International Business Machines
* Copyright (C) 2005-2011, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
@ -14,7 +14,7 @@
#include "unicode/utypes.h"
#ifdef U_WINDOWS
#if U_PLATFORM_HAS_WIN32_API
#if !UCONFIG_NO_FORMATTING
@ -41,6 +41,6 @@ private:
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif // #ifdef U_WINDOWS
#endif // U_PLATFORM_HAS_WIN32_API
#endif // __WINUTIL

View File

@ -1,6 +1,6 @@
#******************************************************************************
#
# Copyright (C) 1999-2010, International Business Machines
# Copyright (C) 1999-2011, International Business Machines
# Corporation and others. All Rights Reserved.
#
#******************************************************************************
@ -32,9 +32,6 @@ BUILDDIR := $(BUILDDIR:test\\iotest/../../=)
# 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)

View File

@ -35,7 +35,7 @@ using namespace std;
#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"

View File

@ -1,5 +1,5 @@
## 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
@ -31,11 +31,7 @@ BUILDDIR := $(BUILDDIR:test\\cintltst/../../=)
# 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@

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 1999-2007, International Business Machines
* Copyright (C) 1999-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -40,7 +40,7 @@ struct TestResult
float *positions;
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct TestResult TestResult;
#endif

View File

@ -1,6 +1,6 @@
/***************************************************************************
*
* Copyright (C) 1998-2008, International Business Machines
* Copyright (C) 1998-2011, International Business Machines
* Corporation and others. All Rights Reserved.
*
************************************************************************/
@ -24,7 +24,7 @@ struct DirectoryEntry
le_uint32 length;
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct DirectoryEntry DirectoryEntry;
#endif
@ -38,7 +38,7 @@ struct SFNTDirectory
DirectoryEntry tableDirectory[ANY_NUMBER];
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct SFNTDirectory SFNTDirectory;
#endif
@ -50,7 +50,7 @@ struct CMAPEncodingSubtableHeader
le_uint32 encodingOffset;
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct CMAPEncodingSubtableHeader CMAPEncodingSubtableHeader;
#endif
@ -61,7 +61,7 @@ struct CMAPTable
CMAPEncodingSubtableHeader encodingSubtableHeaders[ANY_NUMBER];
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct CMAPTable CMAPTable;
#endif
@ -72,11 +72,11 @@ struct CMAPEncodingSubtable
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];
@ -100,11 +100,11 @@ struct CMAPFormat2Subheader
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];
@ -122,7 +122,7 @@ struct CMAPFormat2Encoding
typedef struct CMAPFormat2Encoding CMAPFormat2Encoding;
#endif
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
struct CMAPFormat4Encoding : CMAPEncodingSubtable
{
le_uint16 segCountX2;
@ -160,7 +160,7 @@ struct CMAPFormat4Encoding
typedef struct CMAPFormat4Encoding CMAPFormat4Encoding;
#endif
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
struct CMAPFormat6Encoding : CMAPEncodingSubtable
{
le_uint16 firstCode;
@ -187,7 +187,7 @@ struct CMAPEncodingSubtable32
le_uint32 language;
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct CMAPEncodingSubtable32 CMAPEncodingSubtable32;
#endif
@ -198,11 +198,11 @@ struct CMAPGroup
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];
@ -222,7 +222,7 @@ struct CMAPFormat8Encoding
typedef struct CMAPFormat8Encoding CMAPFormat8Encoding;
#endif
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
struct CMAPFormat10Encoding : CMAPEncodingSubtable32
{
le_uint32 startCharCode;
@ -242,7 +242,7 @@ struct CMAPFormat10Encoding
typedef struct CMAPFormat10Encoding CMAPFormat10Encoding;
#endif
#ifdef XP_CPLUSPLUS
#ifdef __cplusplus
struct CMAPFormat12Encoding : CMAPEncodingSubtable32
{
le_uint32 nGroups;
@ -268,7 +268,7 @@ struct BigDate
le_uint32 ad;
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct BigDate BigDate;
#endif
@ -292,7 +292,7 @@ struct HEADTable
le_int16 glyphDataFormat;
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct HEADTable HEADTable;
#endif
@ -315,7 +315,7 @@ struct MAXPTable
le_uint16 maxComponentDepth;
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct MAXPTable MAXPTable;
#endif
@ -340,7 +340,7 @@ struct HHEATable
le_uint16 numOfLongHorMetrics;
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct HHEATable HHEATable;
#endif
@ -350,7 +350,7 @@ struct LongHorMetric
le_int16 leftSideBearing;
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct LongHorMetric LongHorMetric;
#endif
@ -360,7 +360,7 @@ struct HMTXTable
/* le_int16 leftSideBearing[ANY_NUMBER]; ANY_NUMBER = numGlyphs - numOfLongHorMetrics */
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct HMTXTable HMTXTable;
#endif
@ -429,7 +429,7 @@ struct NameRecord
le_uint16 offset;
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct NameRecord NameRecord;
#endif
@ -441,7 +441,7 @@ struct NAMETable
NameRecord nameRecords[ANY_NUMBER];
};
#ifndef XP_CPLUSPLUS
#ifndef __cplusplus
typedef struct NAMETable NAMETable;
#endif

Some files were not shown because too many files have changed in this diff Show More