ICU-8452 un-autoconf platform.h, move user-configurable settings to uconfig.h, and...
authorMarkus Scherer <markus.icu@gmail.com>
Sat, 23 Jul 2011 00:10:30 +0000 (00:10 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Sat, 23 Jul 2011 00:10:30 +0000 (00:10 +0000)
X-SVN-Rev: 30412

155 files changed:
icu4c/readme.html
icu4c/source/common/Makefile.in
icu4c/source/common/charstr.h
icu4c/source/common/cmemory.h
icu4c/source/common/common.vcxproj
icu4c/source/common/common.vcxproj.filters
icu4c/source/common/cstring.h
icu4c/source/common/locmap.c
icu4c/source/common/putil.cpp
icu4c/source/common/putilimp.h
icu4c/source/common/rbbidata.h
icu4c/source/common/ucln_imp.h
icu4c/source/common/ucnv_bld.cpp
icu4c/source/common/udata.cpp
icu4c/source/common/udatamem.c
icu4c/source/common/umapfile.c
icu4c/source/common/umapfile.h
icu4c/source/common/umutex.c
icu4c/source/common/umutex.h
icu4c/source/common/unicode/platform.h [new file with mode: 0644]
icu4c/source/common/unicode/platform.h.in [deleted file]
icu4c/source/common/unicode/platform.win [deleted file]
icu4c/source/common/unicode/ppalmos.h [deleted file]
icu4c/source/common/unicode/ptypes.h
icu4c/source/common/unicode/putil.h
icu4c/source/common/unicode/pwin32.h [deleted file]
icu4c/source/common/unicode/std_string.h
icu4c/source/common/unicode/uconfig.h
icu4c/source/common/unicode/umachine.h
icu4c/source/common/unicode/uobject.h
icu4c/source/common/unicode/utypes.h
icu4c/source/common/unicode/uversion.h
icu4c/source/common/uprops.h
icu4c/source/common/utrie2.h
icu4c/source/common/wintz.c
icu4c/source/common/wintz.h
icu4c/source/configure
icu4c/source/configure.in
icu4c/source/extra/scrptrun/Makefile.in
icu4c/source/extra/uconv/Makefile.in
icu4c/source/extra/uconv/uconv.cpp
icu4c/source/i18n/Makefile.in
icu4c/source/i18n/datefmt.cpp
icu4c/source/i18n/digitlst.h
icu4c/source/i18n/dtptngen.cpp
icu4c/source/i18n/numfmt.cpp
icu4c/source/i18n/rbt_pars.h
icu4c/source/i18n/timezone.cpp
icu4c/source/i18n/ucol_imp.h
icu4c/source/i18n/uspoof_impl.h
icu4c/source/i18n/windtfmt.cpp
icu4c/source/i18n/windtfmt.h
icu4c/source/i18n/winnmfmt.cpp
icu4c/source/i18n/winnmfmt.h
icu4c/source/i18n/wintzimpl.cpp
icu4c/source/i18n/wintzimpl.h
icu4c/source/io/Makefile.in
icu4c/source/io/ufile.c
icu4c/source/io/ustdio.c
icu4c/source/layout/LETypes.h
icu4c/source/layout/Makefile.in
icu4c/source/layoutex/Makefile.in
icu4c/source/samples/cal/Makefile.in
icu4c/source/samples/date/Makefile.in
icu4c/source/samples/layout/Makefile.in
icu4c/source/stubdata/Makefile.in
icu4c/source/test/cintltst/Makefile.in
icu4c/source/test/cintltst/cbiditst.h
icu4c/source/test/cintltst/ccapitst.c
icu4c/source/test/cintltst/cintltst.c
icu4c/source/test/cintltst/cmsccoll.c
icu4c/source/test/cintltst/cmsgtst.c
icu4c/source/test/cintltst/cnmdptst.c
icu4c/source/test/cintltst/udatatst.c
icu4c/source/test/compat/Makefile.in
icu4c/source/test/hdrtst/pfiles.txt
icu4c/source/test/intltest/Makefile.in
icu4c/source/test/intltest/dtfmttst.cpp
icu4c/source/test/intltest/intltest.cpp
icu4c/source/test/intltest/intltest.h
icu4c/source/test/intltest/nmfmtrt.cpp
icu4c/source/test/intltest/numfmtst.cpp
icu4c/source/test/intltest/numrgts.cpp
icu4c/source/test/intltest/simplethread.cpp
icu4c/source/test/intltest/strtest.cpp
icu4c/source/test/intltest/tsmthred.cpp
icu4c/source/test/intltest/tsnmfmt.cpp
icu4c/source/test/intltest/tsputil.cpp
icu4c/source/test/intltest/uobjtest.cpp
icu4c/source/test/intltest/windttst.cpp
icu4c/source/test/intltest/windttst.h
icu4c/source/test/intltest/winnmtst.cpp
icu4c/source/test/intltest/winnmtst.h
icu4c/source/test/intltest/winutil.cpp
icu4c/source/test/intltest/winutil.h
icu4c/source/test/iotest/Makefile.in
icu4c/source/test/iotest/stream.cpp
icu4c/source/test/letest/Makefile.in
icu4c/source/test/letest/letest.h
icu4c/source/test/letest/sfnt.h
icu4c/source/test/perf/DateFmtPerf/DateFmtPerf.h
icu4c/source/test/perf/DateFmtPerf/Makefile.in
icu4c/source/test/perf/charperf/Makefile.in
icu4c/source/test/perf/collationperf/Makefile.in
icu4c/source/test/perf/collperf/Makefile.in
icu4c/source/test/perf/collperf/collperf.cpp
icu4c/source/test/perf/convperf/Makefile.in
icu4c/source/test/perf/dicttrieperf/Makefile.in
icu4c/source/test/perf/normperf/Makefile.in
icu4c/source/test/perf/normperf/dtfmtrtperf.h
icu4c/source/test/perf/normperf/normperf.h
icu4c/source/test/perf/strsrchperf/Makefile.in
icu4c/source/test/perf/ubrkperf/Makefile.in
icu4c/source/test/perf/ubrkperf/ubrkperf.cpp
icu4c/source/test/perf/ubrkperf/ubrkperf.h
icu4c/source/test/perf/ubrkperf/ubrkperfold.cpp
icu4c/source/test/perf/unisetperf/Makefile.in
icu4c/source/test/perf/usetperf/Makefile.in
icu4c/source/test/perf/ustrperf/Makefile.in
icu4c/source/test/perf/utfperf/Makefile.in
icu4c/source/test/perf/utrie2perf/Makefile.in
icu4c/source/test/testmap/Makefile.in
icu4c/source/test/thaitest/Makefile.in
icu4c/source/test/threadtest/Makefile.in
icu4c/source/test/threadtest/threadtest.cpp
icu4c/source/tools/ctestfw/Makefile.in
icu4c/source/tools/ctestfw/unicode/testtype.h
icu4c/source/tools/ctestfw/unicode/utimer.h
icu4c/source/tools/genbrk/Makefile.in
icu4c/source/tools/genccode/Makefile.in
icu4c/source/tools/genccode/genccode.c
icu4c/source/tools/gencfu/Makefile.in
icu4c/source/tools/gencmn/Makefile.in
icu4c/source/tools/gencnval/Makefile.in
icu4c/source/tools/genctd/Makefile.in
icu4c/source/tools/gennorm2/Makefile.in
icu4c/source/tools/genrb/Makefile.in
icu4c/source/tools/genrb/derb.c
icu4c/source/tools/gensprep/Makefile.in
icu4c/source/tools/gentest/Makefile.in
icu4c/source/tools/icuinfo/Makefile.in
icu4c/source/tools/icuinfo/icuinfo.cpp
icu4c/source/tools/icupkg/Makefile.in
icu4c/source/tools/icuswap/Makefile.in
icu4c/source/tools/makeconv/Makefile.in
icu4c/source/tools/pkgdata/Makefile.in
icu4c/source/tools/pkgdata/pkgdata.cpp
icu4c/source/tools/pkgdata/pkgtypes.h
icu4c/source/tools/toolutil/Makefile.in
icu4c/source/tools/toolutil/filestrm.c
icu4c/source/tools/toolutil/pkg_genc.c
icu4c/source/tools/toolutil/platform_xopen_source_extended.h
icu4c/source/tools/toolutil/toolutil.cpp
icu4c/source/tools/toolutil/toolutil.h
icu4c/source/tools/toolutil/uoptions.h

index b75aa9a30f5cfbee85dd6d98a2719b21e1b7f3d5..5fa13f0a5a3c57b0c237dfca1e18f065c3cb6c79 100644 (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>
     As a result, for example, rather than <code>U_NAMESPACE_QUALIFIER UnicodeString</code>
     you can now simply write <code>icu::UnicodeString</code>.</p>
 
+    <h3>One shared platform.h</h3>
+    <p>ICU4C 49 does not generate any source code files via autoconf any more.
+    Instead, platform.h itself is now a normal source header file,
+    and determines platform-specific settings via <code>#if ...</code> etc.</p>
+
+    <p>As a result, it is easier to cross-compile ICU4C and/or use different build systems.
+    No more headers are <code>#include</code>d from the build-output directory,
+    and all platforms use the same set of source code files.</p>
+
+    <p>However, it is likely that ICU4C 49 will not compile on some platforms
+    (non-POSIX and/or older/unusual compilers etc.) that the ICU team did not test.
+    As a temporary workaround, any platform-dependent macro for which <code>platform.h</code>
+    does not determine the correct value can be predefined via <code>CPPFLAGS</code>
+    or by adding an explicit <code>#define ...</code> into <code>platform.h</code>
+    before it first tests that macro.</p>
+
+    <p>Please submit a bug ticket per platform with details about your compiler,
+    its version and its predefined macros.
+    (For example, preprocessing an empty source file with gcc's <code>-dM</code> option
+    outputs all of gcc's predefined macros: <code>gcc -E -dM -x c /dev/null | sort</code>)
+    A patch to fix the problem would be welcome too!</p>
+
     <h2><a name="Download" href="#Download" id="Download">How To Download the
     Source Code</a></h2>
 
         for applications to include and get the correct entry point names.</li>
     </ul>
 
+    <h3><a name="UserConfig" href="#UserConfig" id="UserConfig">User-Configurable Settings</a></h3>
+    <p>ICU4C can be customized via a number of user-configurable settings.
+    Many of them are controlled by preprocessor macros which are
+    defined in the <code>source/common/unicode/uconfig.h</code> header file.
+    Some turn off parts of ICU, for example conversion or collation,
+    trading off a smaller library for reduced functionality.
+    Other settings are recommended (see previous section)
+    but their default values are set for better source code compatibility.</p>
+
+    <p>In order to change such user-configurable settings, you can
+    either modify the <code>uconfig.h</code> header file by adding
+    a specific <code>#define ...</code> for one or more of the macros
+    before they are first tested,
+    or set the compiler's preprocessor flags (<code>CPPFLAGS</code>) to include
+    an equivalent <code>-D</code> macro definition.</p>
+
     <h3><a name="HowToBuildWindows" href="#HowToBuildWindows" id=
     "HowToBuildWindows">How To Build And Install On Windows</a></h3>
 
index 9e8d81facbd85594c073e4dcbeda020db5610a9e..36774e2e6f0298c63d74537ade9102957a47b56f 100644 (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)$@ $^
index 2eb87a0791fbf2c533ba715326a8e7e74b2ef179..da391e245d0b7a8e666b12c24f108f4fc34e39cb 100644 (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
 
index 68daccaf35b30373f51287fee10d507efa39b87e..b6bc172e9ccb57cf27dd9ff3a1b6470d21de2075 100644 (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 */
index 5c8edc9b6e8c0e1b2caf94222aa5a9e5593dae60..ec679931911bc35077503443d56bf6564f7e9644 100644 (file)
     </CustomBuild>\r
     <ClInclude Include="locmap.h" />\r
     <ClInclude Include="mutex.h" />\r
-    <CustomBuild Include="unicode\putil.h">\r
+    <CustomBuild Include="unicode\platform.h">\r
       <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode\r
 </Command>\r
       <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
 </Command>\r
       <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
     </CustomBuild>\r
-    <ClInclude Include="putilimp.h" />\r
-    <CustomBuild Include="unicode\pwin32.h">\r
+    <CustomBuild Include="unicode\ptypes.h">\r
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode\r
+</Command>\r
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">copy "%(FullPath)" ..\..\include\unicode\r
+</Command>\r
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy "%(FullPath)" ..\..\include\unicode\r
+</Command>\r
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">copy "%(FullPath)" ..\..\include\unicode\r
+</Command>\r
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
+    </CustomBuild>\r
+    <CustomBuild Include="unicode\putil.h">\r
       <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode\r
 </Command>\r
       <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
 </Command>\r
       <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\include\unicode\%(Filename)%(Extension);%(Outputs)</Outputs>\r
     </CustomBuild>\r
+    <ClInclude Include="putilimp.h" />\r
     <CustomBuild Include="unicode\std_string.h">\r
       <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)" ..\..\include\unicode\r
 </Command>\r
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
     </ProjectReference>\r
   </ItemGroup>\r
-  <ItemGroup>\r
-    <CustomBuild Include="unicode\platform.win">\r
-      <FileType>Document</FileType>\r
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">copy "%(FullPath)"  unicode\%(FileName).h\r
-copy "%(FullPath)"  ..\..\include\unicode\%(FileName).h</Command>\r
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">unicode\%(Filename).h;..\..\include\unicode\%(Filename).h;%(Outputs)</Outputs>\r
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">copy "%(FullPath)"  unicode\%(FileName).h\r
-copy "%(FullPath)"  ..\..\include\unicode\%(FileName).h</Command>\r
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">unicode\%(Filename).h;..\..\include\unicode\%(Filename).h;%(Outputs)</Outputs>\r
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">copy "%(FullPath)"  unicode\%(FileName).h\r
-copy "%(FullPath)"  ..\..\include\unicode\%(FileName).h</Command>\r
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">unicode\%(Filename).h;..\..\include\unicode\%(Filename).h;%(Outputs)</Outputs>\r
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">copy "%(FullPath)"  unicode\%(FileName).h\r
-copy "%(FullPath)"  ..\..\include\unicode\%(FileName).h</Command>\r
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">unicode\%(Filename).h;..\..\include\unicode\%(Filename).h;%(Outputs)</Outputs>\r
-    </CustomBuild>\r
-  </ItemGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
index 26f1c6945168b65985c3d142a8b7e9374b8ec37c..1e4ae39601fbf54003c53bfc89fd0be1102cde26 100644 (file)
     <CustomBuild Include="unicode\icudataver.h">\r
       <Filter>configuration</Filter>\r
     </CustomBuild>\r
-    <CustomBuild Include="unicode\platform.win">\r
+    <CustomBuild Include="unicode\platform.h">\r
       <Filter>configuration</Filter>\r
     </CustomBuild>\r
-    <CustomBuild Include="unicode\putil.h">\r
+    <CustomBuild Include="unicode\ptypes.h">\r
       <Filter>configuration</Filter>\r
     </CustomBuild>\r
-    <CustomBuild Include="unicode\pwin32.h">\r
+    <CustomBuild Include="unicode\putil.h">\r
       <Filter>configuration</Filter>\r
     </CustomBuild>\r
     <CustomBuild Include="unicode\std_string.h">\r
index 6d2fd0e8159bcda045cb66246923bca53f9117b5..26528e5987537100d87e697555032f20d3029a7c 100644 (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)
index dc06318ca3d7e2520d91100fa433e58ead699a93..ebf38aefae9c68b6bcab79c33d88f7c04fc0f5d5 100644 (file)
 #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
 
index a321fd45f7c82d574705ff24f0f4a3b188f88c73..10eeb0b89d78250467af24df0e46fb678243ea8c 100644 (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) {
index 863e0291aa4cf1667433365a8ada86c50df3526b..cee8026b230012004252a4617874ebde20f494fa 100644 (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
     /*
index ee6aa486160c46a40268fa4a27e1f521893f00af..e8ef322e4d7586bd26089ba64250025d97c005de 100644 (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"
index 2608fb2c7559d98c42c26f79ee7f3f2314e1b008..d5d202ecde6b720db178fe96e658704b769d8313 100644 (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 */
index efef4f24d6499cfc4380559368fde09e3f7fe7d2..b3f8951c1dab6f0677e1e4f4fb4769b304b94f3b 100644 (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";
index 43f50af84ad41980c8a725e18549e16a7f08acff..bdf910a4cdeb4647133f7a693416ac09a4a78681 100644 (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
index 2c9741e527b71c047e8497a19d2ec803c56c904c..ec6175d985791739a75f7db71f01983e4fecc067 100644 (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
 
index f9f857e9dbeea777e61d9df10a114001b5fe7df9..05caecfff2c5ca8318d30488a9ff825433e40590 100644 (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.
 *
 ******************************************************************************/
 #       define LIB_SUFFIX ".dll"
         /* This is inconvienient until we figure out what to do with U_ICUDATA_NAME in utypes.h */
 #       define U_ICUDATA_ENTRY_NAME "icudt" U_ICU_VERSION_SHORT U_LIB_SUFFIX_C_NAME_STRING "_dat"
-#   else
-#       if defined(U_DARWIN)
-#           include <TargetConditionals.h>
-#       endif
 #   endif
 #elif MAP_IMPLEMENTATION==MAP_STDIO
 #   include <stdio.h>
         }
 
         /* get a view of the mapping */
-#ifndef U_HPUX
+#if U_PLATFORM != U_PF_HPUX
         data=mmap(0, length, PROT_READ, MAP_SHARED,  fd, 0);
 #else
         data=mmap(0, length, PROT_READ, MAP_PRIVATE, fd, 0);
         pData->map = (char *)data + length;
         pData->pHeader=(const DataHeader *)data;
         pData->mapAddr = data;
-#if defined(U_DARWIN) && TARGET_OS_IPHONE
+#if U_PLATFORM == U_PF_IPHONE
         posix_madvise(data, length, POSIX_MADV_RANDOM);
 #endif
         return TRUE;
index f8bf77b92ccc58c21a94a6e071883d3c7d53075d..1f4b43c5d9e1c31b5c6db58a5a024b47196412ed 100644 (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
index e3bbda6df4cd3bea9e046485313e355f0e0bded6..5be6eb95ef532e2267c739cfff63ce6c5b019a0d 100644 (file)
  * 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
             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
     }
index 3083bda64545dea2789e26e62e950f244cdd6b03..089afb775e5f7a2d18a2f2dfb25b3e619c083a07 100644 (file)
 #include "unicode/utypes.h"
 #include "unicode/uclean.h"
 
-#if defined(U_WINDOWS)
+#if defined(_MSC_VER) && _MSC_VER >= 1500
 # include <intrin.h>
 #endif
 
-#if defined(U_DARWIN)
+#if U_PLATFORM_IS_DARWIN_BASED
 #if defined(__STRICT_ANSI__)
 #define UPRV_REMAP_INLINE
 #define inline
 # define ANNOTATE_UNPROTECTED_READ(x) (x)
 #endif
 
-/* APP_NO_THREADS is an old symbol. We'll honour it if present. */
-#ifdef APP_NO_THREADS
-# define ICU_USE_THREADS 0
-#endif
-
-/* ICU_USE_THREADS
- *
- *   Allows thread support (use of mutexes) to be compiled out of ICU.
- *   Default: use threads.
- *   Even with thread support compiled out, applications may override the
- *   (empty) mutex implementation with the u_setMutexFunctions() functions.
- */
-#ifndef ICU_USE_THREADS
-# define ICU_USE_THREADS 1
-#endif
-
 #ifndef UMTX_FULL_BARRIER
 # if !ICU_USE_THREADS
 #  define UMTX_FULL_BARRIER
 # elif U_HAVE_GCC_ATOMICS
 #  define UMTX_FULL_BARRIER __sync_synchronize();
-# elif defined(U_WINDOWS) && !(defined(_MSC_VER) && !(_MSC_VER >= 1500))
+# elif defined(_MSC_VER) && _MSC_VER >= 1500
+    /* From MSVC intrin.h. Use _ReadWriteBarrier() only on MSVC 9 and higher. */
 #  define UMTX_FULL_BARRIER _ReadWriteBarrier();
-# elif defined(U_DARWIN)
+# elif U_PLATFORM_IS_DARWIN_BASED
 #  define UMTX_FULL_BARRIER OSMemoryBarrier();
 # else
 #  define UMTX_FULL_BARRIER \
diff --git a/icu4c/source/common/unicode/platform.h b/icu4c/source/common/unicode/platform.h
new file mode 100644 (file)
index 0000000..c8f4221
--- /dev/null
@@ -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 (1984–2001) @internal */
+#define U_PF_CLASSIC_MACOS 8000
+/** z/OS is the successor to OS/390 which was the successor to MVS. @internal */
+#define U_PF_OS390 9000
+/** "IBM i" is the current name of what used to be i5/OS and earlier OS/400. @internal */
+#define U_PF_OS400 9400
+
+#ifdef U_PLATFORM
+    /* Use the predefined value. */
+#elif defined(__MINGW32__)
+#   define U_PLATFORM U_PF_MINGW
+#elif defined(__CYGWIN__)
+#   define U_PLATFORM U_PF_CYGWIN
+#elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
+#   define U_PLATFORM U_PF_WINDOWS
+#elif defined(__ANDROID__)
+#   define U_PLATFORM U_PF_ANDROID
+    /* Android wchar_t support depends on the API level. */
+#   include <android/api-level.h>
+#elif defined(linux) || defined(__linux__) || defined(__linux)
+#   define U_PLATFORM U_PF_LINUX
+#elif defined(BSD)
+#   define U_PLATFORM U_PF_BSD
+#elif defined(sun) || defined(__sun)
+    /* Check defined(__SVR4) || defined(__svr4__) to distinguish Solaris from SunOS? */
+#   define U_PLATFORM U_PF_SOLARIS
+#elif defined(_AIX) || defined(__TOS_AIX__)
+#   define U_PLATFORM U_PF_AIX
+#elif defined(_hpux) || defined(hpux) || defined(__hpux)
+#   define U_PLATFORM U_PF_HPUX
+#elif defined(sgi) || defined(__sgi)
+#   define U_PLATFORM U_PF_IRIX
+#elif defined(__APPLE__) && defined(__MACH__)
+#   include <TargetConditionals.h>
+#   ifdef TARGET_OS_IPHONE  /* variant of TARGET_OS_MAC */
+#       define U_PLATFORM U_PF_IPHONE
+#   else
+#       define U_PLATFORM U_PF_DARWIN
+#   endif
+#elif defined(macintosh)
+#   define U_PLATFORM U_PF_CLASSIC_MACOS
+#elif defined(__QNX__) || defined(__QNXNTO__)
+#   define U_PLATFORM U_PF_QNX
+#elif defined(__TOS_MVS__)
+#   define U_PLATFORM U_PF_OS390
+#elif defined(__OS400__) || defined(__TOS_OS400__)
+#   define U_PLATFORM U_PF_OS400
+#else
+#   define U_PLATFORM U_PF_UNKNOWN
+#endif
+
+/**
+ * \def U_PLATFORM_USES_ONLY_WIN32_API
+ * Defines whether the platform uses only the Win32 API.
+ * Set to 1 for Windows/MSVC and MinGW but not Cygwin.
+ * @internal
+ */
+#ifdef U_PLATFORM_USES_ONLY_WIN32_API
+    /* Use the predefined value. */
+#elif U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_MINGW
+#   define U_PLATFORM_USES_ONLY_WIN32_API 1
+#else
+    /* Cygwin implements POSIX. */
+#   define U_PLATFORM_USES_ONLY_WIN32_API 0
+#endif
+
+/**
+ * \def U_PLATFORM_HAS_WIN32_API
+ * Defines whether the Win32 API is available on the platform.
+ * Set to 1 for Windows/MSVC, MinGW and Cygwin.
+ * @internal
+ */
+#ifdef U_PLATFORM_HAS_WIN32_API
+    /* Use the predefined value. */
+#elif U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
+#   define U_PLATFORM_HAS_WIN32_API 1
+#else
+#   define U_PLATFORM_HAS_WIN32_API 0
+#endif
+
+/**
+ * \def U_PLATFORM_IMPLEMENTS_POSIX
+ * Defines whether the platform implements (most of) the POSIX API.
+ * Set to 1 for Cygwin and most other platforms.
+ * @internal
+ */
+#ifdef U_PLATFORM_IMPLEMENTS_POSIX
+    /* Use the predefined value. */
+#elif U_PLATFORM_USES_ONLY_WIN32_API || U_PLATFORM == U_PF_CLASSIC_MACOS
+#   define U_PLATFORM_IMPLEMENTS_POSIX 0
+#else
+#   define U_PLATFORM_IMPLEMENTS_POSIX 1
+#endif
+
+/**
+ * \def CYGWINMSVC
+ * Defined if this is Windows with Cygwin, but using MSVC rather than gcc.
+ * Otherwise undefined.
+ * @internal
+ */
+#if U_PLATFORM == U_PF_CYGWIN && defined(_MSC_VER)
+#   define CYGWINMSVC
+#endif
+
+/**
+ * \def U_PLATFORM_IS_LINUX_BASED
+ * Defines whether the platform is Linux or one of its derivatives.
+ * @internal
+ */
+#ifdef U_PLATFORM_IS_LINUX_BASED
+    /* Use the predefined value. */
+#elif U_PF_LINUX <= U_PLATFORM && U_PLATFORM <= U_PF_ANDROID
+#   define U_PLATFORM_IS_LINUX_BASED 1
+#else
+#   define U_PLATFORM_IS_LINUX_BASED 0
+#endif
+
+/**
+ * \def U_PLATFORM_IS_DARWIN_BASED
+ * Defines whether the platform is Darwin or one of its derivatives.
+ * @internal
+ */
+#ifdef U_PLATFORM_IS_DARWIN_BASED
+    /* Use the predefined value. */
+#elif U_PF_DARWIN <= U_PLATFORM && U_PLATFORM <= U_PF_IPHONE
+#   define U_PLATFORM_IS_DARWIN_BASED 1
+#else
+#   define U_PLATFORM_IS_DARWIN_BASED 0
+#endif
+
+/**
+ * \def U_HAVE_DIRENT_H
+ * Defines whether dirent.h is available.
+ * @internal
+ */
+#ifdef U_HAVE_DIRENT_H
+    /* Use the predefined value. */
+#elif U_PLATFORM_HAS_WIN32_API
+#   define U_HAVE_DIRENT_H 0
+#else
+#   define U_HAVE_DIRENT_H 1
+#endif
+
+/**
+ * \def U_HAVE_STDINT_H
+ * Defines whether stdint.h is available. It is a C99 standard header.
+ * We used to include inttypes.h which includes stdint.h but we usually do not need
+ * the additional definitions from inttypes.h.
+ * @internal
+ */
+#ifdef U_HAVE_STDINT_H
+    /* Use the predefined value. */
+#elif U_PLATFORM_USES_ONLY_WIN32_API
+#   if defined(__BORLANDC__) || (defined(_MSC_VER) && _MSC_VER>=1600)
+        /* Windows Visual Studio 9 and below do not have stdint.h & inttypes.h, but VS 2010 adds them. */
+#       define U_HAVE_STDINT_H 1
+#   else
+#       define U_HAVE_STDINT_H 0
+#   endif
+#elif U_PLATFORM == U_PF_SOLARIS
+    /* Solaris has inttypes.h but not stdint.h. */
+#   define U_HAVE_STDINT_H 0
+#else
+#   define U_HAVE_STDINT_H 1
+#endif
+
+/**
+ * \def U_HAVE_INTTYPES_H
+ * Defines whether inttypes.h is available. It is a C99 standard header.
+ * We include inttypes.h where it is available but stdint.h is not.
+ * @internal
+ */
+#ifdef U_HAVE_INTTYPES_H
+    /* Use the predefined value. */
+#elif U_PLATFORM == U_PF_SOLARIS
+    /* Solaris has inttypes.h but not stdint.h. */
+#   define U_HAVE_INTTYPES_H 1
+#else
+    /* Most platforms have both inttypes.h and stdint.h, or neither. */
+#   define U_HAVE_INTTYPES_H U_HAVE_STDINT_H
+#endif
+
+/**
+ * \def U_IOSTREAM_SOURCE
+ * Defines what support for C++ streams is available.
+ *
+ * If U_IOSTREAM_SOURCE is set to 199711, then &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 32–bit in the 64–bit environment and
+     * 16–bit in the 32–bit environment."
+     * and
+     * "All locales use Unicode for their wide character code values (process code),
+     * except the IBM-eucTW codeset."
+     */
+#   ifdef __64BIT__
+#       define U_SIZEOF_WCHAR_T 4
+#   else
+#       define U_SIZEOF_WCHAR_T 2
+#   endif
+#elif U_PLATFORM == U_PF_OS390
+    /*
+     * z/OS V1R11 information center, section "LP64 | ILP32":
+     * "In 31-bit mode, the size of long and pointers is 4 bytes and the size of wchar_t is 2 bytes.
+     * Under LP64, the size of long and pointer is 8 bytes and the size of wchar_t is 4 bytes."
+     */
+#   ifdef _LP64
+#       define U_SIZEOF_WCHAR_T 4
+#   else
+#       define U_SIZEOF_WCHAR_T 2
+#   endif
+#elif U_PLATFORM == U_PF_OS400
+#   if defined(__UTF32__)
+        /*
+         * LOCALETYPE(*LOCALEUTF) is specified.
+         * Wide-character strings are in UTF-32,
+         * narrow-character strings are in UTF-8.
+         */
+#       define U_SIZEOF_WCHAR_T 4
+#   elif defined(__UCS2__)
+        /*
+         * LOCALETYPE(*LOCALEUCS2) is specified.
+         * Wide-character strings are in UCS-2,
+         * narrow-character strings are in EBCDIC.
+         */
+#       define U_SIZEOF_WCHAR_T 2
+#else
+        /*
+         * LOCALETYPE(*CLD) or LOCALETYPE(*LOCALE) is specified.
+         * Wide-character strings are in 16-bit EBCDIC,
+         * narrow-character strings are in EBCDIC.
+         */
+#       define U_SIZEOF_WCHAR_T 2
+#   endif
+#else
+#   define U_SIZEOF_WCHAR_T 4
+#endif
+
+#ifndef U_HAVE_WCSCPY
+#define U_HAVE_WCSCPY U_HAVE_WCHAR_H
+#endif
+
+/** @} */
+
+/**
+ * \def U_HAVE_CHAR16_T
+ * Defines whether the char16_t type is available for UTF-16
+ * and u"abc" UTF-16 string literals are supported.
+ * This is a new standard type and standard string literal syntax in C++0x
+ * but has been available in some compilers before.
+ * @internal
+ */
+#ifdef U_HAVE_CHAR16_T
+    /* Use the predefined value. */
+#else
+    /*
+     * Notes:
+     * Visual Studio 10 (_MSC_VER>=1600) defines char16_t but
+     * does not support u"abc" string literals.
+     * gcc 4.4 defines the __CHAR16_TYPE__ macro to a usable type but
+     * does not support u"abc" string literals.
+     */
+#   define U_HAVE_CHAR16_T 0
+#endif
+
+/**
+ * @{
+ * \def U_DECLARE_UTF16
+ * Do not use this macro because it is not defined on all platforms.
+ * Use the UNICODE_STRING or U_STRING_DECL macros instead.
+ * @internal
+ */
+#ifdef U_DECLARE_UTF16
+    /* Use the predefined value. */
+#elif (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
+    || (defined(__HP_aCC) && __HP_aCC >= 035000) \
+    || (defined(__HP_cc) && __HP_cc >= 111106) \
+    || U_HAVE_CHAR16_T
+#   define U_DECLARE_UTF16(string) u ## string
+#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
+/* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
+/* Sun's C compiler has issues with this notation, and it's unreliable. */
+#   define U_DECLARE_UTF16(string) U ## string
+#elif U_SIZEOF_WCHAR_T == 2 \
+    && (U_CHARSET_FAMILY == 0 || (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400 && defined(__UCS2__)))
+#   define U_DECLARE_UTF16(string) L ## string
+#else
+    /* Leave U_DECLARE_UTF16 undefined. See unistr.h. */
+#endif
+
+/** @} */
+
+/*===========================================================================*/
+/** @{ Information about POSIX support                                       */
+/*===========================================================================*/
+
+#ifdef U_HAVE_NL_LANGINFO_CODESET
+    /* Use the predefined value. */
+#elif U_PLATFORM_HAS_WIN32_API
+#   define U_HAVE_NL_LANGINFO_CODESET 0
+#else
+#   define U_HAVE_NL_LANGINFO_CODESET 1
+#endif
+
+#ifdef U_NL_LANGINFO_CODESET
+    /* Use the predefined value. */
+#elif !U_HAVE_NL_LANGINFO_CODESET
+#   define U_NL_LANGINFO_CODESET -1
+#else
+#   define U_NL_LANGINFO_CODESET CODESET
+#endif
+
+#ifdef U_TZSET
+    /* Use the predefined value. */
+#elif U_PLATFORM_HAS_WIN32_API
+#   define U_TZSET _tzset
+#else
+#   define U_TZSET tzset
+#endif
+
+#ifdef U_TIMEZONE
+    /* Use the predefined value. */
+#elif U_PLATFORM_IS_LINUX_BASED
+#   define U_TIMEZONE __timezone
+#elif U_PLATFORM_HAS_WIN32_API
+#   define U_TIMEZONE _timezone
+#else
+#   define U_TIMEZONE timezone
+#endif
+
+#ifdef U_TZNAME
+    /* Use the predefined value. */
+#elif U_PLATFORM_HAS_WIN32_API
+#   define U_TZNAME _tzname
+#else
+#   define U_TZNAME tzname
+#endif
+
+#ifdef U_HAVE_MMAP
+    /* Use the predefined value. */
+#elif U_PLATFORM_HAS_WIN32_API
+#   define U_HAVE_MMAP 0
+#else
+#   define U_HAVE_MMAP 1
+#endif
+
+#ifdef U_HAVE_POPEN
+    /* Use the predefined value. */
+#elif U_PLATFORM_HAS_WIN32_API
+#   define U_HAVE_POPEN 0
+#else
+#   define U_HAVE_POPEN 1
+#endif
+
+/** @} */
+
+/*===========================================================================*/
+/** @{ Symbol import-export control                                          */
+/*===========================================================================*/
+
+#ifdef U_EXPORT
+    /* Use the predefined value. */
+#elif defined(U_STATIC_IMPLEMENTATION)
+#   define U_EXPORT
+#elif defined(__GNUC__)
+#   define U_EXPORT __attribute__((visibility("default")))
+#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
+   || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550) 
+#   define U_EXPORT __global
+/*#elif defined(__HP_aCC) || defined(__HP_cc)
+#   define U_EXPORT __declspec(dllexport)*/
+#elif defined(_MSC_VER)
+#   define U_EXPORT __declspec(dllexport)
+#else
+#   define U_EXPORT
+#endif
+
+/* U_CALLCONV is releated to U_EXPORT2 */
+#ifdef U_EXPORT2
+    /* Use the predefined value. */
+#elif defined(_MSC_VER)
+#   define U_EXPORT2 __cdecl
+#else
+#   define U_EXPORT2
+#endif
+
+#ifdef U_IMPORT
+    /* Use the predefined value. */
+#elif defined(_MSC_VER)
+    /* Windows needs to export/import data. */
+#   define U_IMPORT __declspec(dllimport)
+#else
+#   define U_IMPORT 
+#endif
+
+/**
+ * \def U_CALLCONV
+ * Similar to U_CDECL_BEGIN/U_CDECL_END, this qualifier is necessary
+ * in callback function typedefs to make sure that the calling convention
+ * is compatible.
+ *
+ * This is only used for non-ICU-API functions.
+ * When a function is a public ICU API,
+ * you must use the U_CAPI and U_EXPORT2 qualifiers.
+ * @stable ICU 2.0
+ */
+#if U_PLATFORM == U_PF_OS390 && defined(__cplusplus)
+#    define U_CALLCONV __cdecl
+#else
+#    define U_CALLCONV U_EXPORT2
+#endif
+
+/* @} */
+
+/*===========================================================================*/
+/** @{ Code alignment                                                        */
+/*===========================================================================*/
+
+/**
+ * \def U_ALIGN_CODE
+ * This is used to align code fragments to a specific byte boundary.
+ * This is useful for getting consistent performance test results.
+ * @internal
+ */
+#ifdef U_ALIGN_CODE
+    /* Use the predefined value. */
+#elif defined(_MSC_VER) && defined(_M_IX86) && !defined(_MANAGED)
+#   define U_ALIGN_CODE(boundarySize) __asm  align boundarySize
+#else
+#   define U_ALIGN_CODE(boundarySize) 
+#endif
+
+/** @} */
+
+/**
+ * \def U_HAVE_MSVC_2003_OR_EARLIER
+ * Flag for workaround of MSVC 2003 optimization bugs
+ * @internal
+ */
+#if !defined(U_HAVE_MSVC_2003_OR_EARLIER) && defined(_MSC_VER) && (_MSC_VER < 1400)
+#define U_HAVE_MSVC_2003_OR_EARLIER
+#endif
+
+/*===========================================================================*/
+/** @{ GCC built in functions for atomic memory operations                   */
+/*===========================================================================*/
+
+/**
+ * \def U_HAVE_GCC_ATOMICS
+ * @internal
+ */
+#ifdef U_HAVE_GCC_ATOMICS
+    /* Use the predefined value. */
+#elif defined(__GNUC__)
+#   define U_HAVE_GCC_ATOMICS 1
+#else
+#   define U_HAVE_GCC_ATOMICS 0
+#endif
+
+/** @} */
+
+/*===========================================================================*/
+/** @{ Programs used by ICU code                                             */
+/*===========================================================================*/
+
+/**
+ * \def U_MAKE_IS_NMAKE
+ * Defines whether the "make" program is Windows nmake.
+ */
+#ifdef U_MAKE_IS_NMAKE
+    /* Use the predefined value. */
+#elif U_PLATFORM == U_PF_WINDOWS
+#   define U_MAKE_IS_NMAKE 1
+#else
+#   define U_MAKE_IS_NMAKE 0
+#endif
+
+/** @} */
+
+/*===========================================================================*/
+/* Custom icu entry point renaming                                           */
+/*===========================================================================*/
+
+#if U_HAVE_LIB_SUFFIX
+# ifndef U_ICU_ENTRY_POINT_RENAME
+/* Renaming pattern:    u_strcpy_41_suffix */
+#  define U_ICU_ENTRY_POINT_RENAME(x)    x ## _ ## U_ICU_VERSION_MAJOR_NUM ## U_LIB_SUFFIX_C_NAME
+#  define U_DEF_ICUDATA_ENTRY_POINT(major) icudt ## U_LIB_SUFFIX_C_NAME ## major ##_dat
+
+# endif
+#endif
+
+#endif
diff --git a/icu4c/source/common/unicode/platform.h.in b/icu4c/source/common/unicode/platform.h.in
deleted file mode 100644 (file)
index 4331397..0000000
+++ /dev/null
@@ -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
diff --git a/icu4c/source/common/unicode/platform.win b/icu4c/source/common/unicode/platform.win
deleted file mode 100644 (file)
index 5113f1f..0000000
+++ /dev/null
@@ -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
-
diff --git a/icu4c/source/common/unicode/ppalmos.h b/icu4c/source/common/unicode/ppalmos.h
deleted file mode 100644 (file)
index 46ef320..0000000
+++ /dev/null
@@ -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
index 1f34d2f84e410ef7930a66ef6e74cb64bcbc581d..008e3bdcd77cdf9018f8647157735b94566dfdad 100644 (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.
 *
 ******************************************************************************
 /* Generic data types                                                        */
 /*===========================================================================*/
 
-/* If your platform does not have the <inttypes.h> header, you may
-   need to edit the typedefs below. */
-#if U_HAVE_INTTYPES_H
+/* If your platform does not have the <stdint.h> header, you may
+   need to edit the typedefs in the #else section below.
+   Use #if...#else...#endif with predefined compiler macros if possible. */
+#if U_HAVE_STDINT_H
 
-/* autoconf 2.13 sometimes can't properly find the data types in <inttypes.h> */
-/* os/390 needs <inttypes.h>, but it doesn't have int8_t, and it sometimes */
-/* doesn't have uint8_t depending on the OS version. */
-/* So we have this work around. */
-#ifdef OS390
+/*
+ * We mostly need <stdint.h> (which defines the standard integer types) but not <inttypes.h>.
+ * <inttypes.h> includes <stdint.h> and adds the printf/scanf helpers PRId32, SCNx16 etc.
+ * which we almost never use, plus stuff like imaxabs() which we never use.
+ */
+#include <stdint.h>
+
+/* z/OS has <stdint.h>, but some versions are missing int8_t and/or uint8_t (APAR PK62248). */
+#if U_PLATFORM == U_PF_OS390
 /* The features header is needed to get (u)int64_t sometimes. */
 #include <features.h>
-#if ! U_HAVE_INT8_T
+#if !defined(__int8_t)
+#define __int8_t 1
 typedef signed char int8_t;
 #endif
 #if !defined(__uint8_t)
 #define __uint8_t 1
 typedef unsigned char uint8_t;
 #endif
-#endif /* OS390 */
+#endif /* U_PLATFORM == U_PF_OS390 */
+
+#elif U_HAVE_INTTYPES_H
 
-#include <inttypes.h>
+#   include <inttypes.h>
 
-#else /* U_HAVE_INTTYPES_H */
+#else /* neither U_HAVE_STDINT_H nor U_HAVE_INTTYPES_H */
 
 #if ! U_HAVE_INT8_T
 typedef signed char int8_t;
@@ -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 */
-
index 090b226f1de7b330dce86307df6fc7a5bc2a82fc..5bd5983f0ab93888cb8d6112ac4dc964fd5268e2 100644 (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 ';'
diff --git a/icu4c/source/common/unicode/pwin32.h b/icu4c/source/common/unicode/pwin32.h
deleted file mode 100644 (file)
index 7970cb2..0000000
+++ /dev/null
@@ -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
-
-/** @} */
-
index 2cd403ba988c39ab8a863dd31a434f0e7fa81045..67b1d6c5aad10a0b62837c2525477635b6b01f22 100644 (file)
 
 #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>
index f7546bfc87778c0b6e37f045d6943082485f1ec4..4a9f55c0b7c8250076a4d48873f02ac7b29b570c 100644 (file)
 
 /*!
  * \file
- * \brief Switches for excluding parts of ICU library code modules.
+ * \brief User-configurable settings
  *
- * Allows to build partial, smaller libraries for special purposes.
+ * Miscellaneous switches:
+ *
+ * A number of macros affect a variety of minor aspects of ICU.
+ * Most of them used to be defined elsewhere (e.g., in utypes.h or platform.h)
+ * and moved here to make them easier to find.
+ *
+ * Switches for excluding parts of ICU library code modules:
+ *
+ * Changing these macros allows building partial, smaller libraries for special purposes.
  * By default, all modules are built.
  * The switches are fairly coarse, controlling large modules.
  * Basic services cannot be turned off.
 /**
  * If this switch is defined, ICU will attempt to load a header file named "uconfig_local.h"
  * prior to determining default settings for uconfig variables.
- * 
+ *
  * @internal ICU 4.0
- * 
  */
 #if defined(UCONFIG_USE_LOCAL)
 #include "uconfig_local.h"
 #endif
 
+/**
+ * \def U_DEBUG
+ * Determines whether to include debugging code.
+ * Automatically set on Windows, but most compilers do not have
+ * related predefined macros.
+ * @internal
+ */
+#ifdef U_DEBUG
+    /* Use the predefined value. */
+#elif defined(_DEBUG)
+    /*
+     * _DEBUG is defined by Visual Studio debug compilation.
+     * Do *not* test for its NDEBUG macro: It is an orthogonal macro
+     * which disables assert().
+     */
+#   define U_DEBUG 1
+#elif defined(U_RELEASE)
+#   define U_DEBUG (!U_RELEASE)
+# else
+#   define U_DEBUG 0
+#endif
+
+/**
+ * \def U_DEBUG
+ * Opposite of U_DEBUG.
+ * @internal
+ */
+#ifndef U_RELEASE
+#define U_RELEASE (!U_DEBUG)
+#endif
+
+/**
+ * Determines wheter to enable auto cleanup of libraries. 
+ * @internal
+ */
+#ifndef UCLN_NO_AUTO_CLEANUP
+#define UCLN_NO_AUTO_CLEANUP 1
+#endif
+
+/**
+ * \def ICU_USE_THREADS
+ *
+ * Allows thread support (use of mutexes) to be compiled out of ICU.
+ * Default: use threads.
+ *
+ * Even with thread support compiled out, applications may override the
+ * (empty) mutex implementation with the u_setMutexFunctions() functions.
+ * @internal
+ */
+#ifdef ICU_USE_THREADS
+    /* Use the predefined value. */
+#elif defined(APP_NO_THREADS)
+    /* APP_NO_THREADS is an old symbol. We'll honour it if present. */
+#   define ICU_USE_THREADS 0
+#else
+#   define ICU_USE_THREADS 1
+#endif
+
+/**
+ * \def U_DISABLE_RENAMING
+ * Determines whether to disable renaming or not.
+ * @internal
+ */
+#ifndef U_DISABLE_RENAMING
+#define U_DISABLE_RENAMING 0
+#endif
+
+/**
+ * \def U_OVERRIDE_CXX_ALLOCATION
+ * Determines whether to override new and delete.
+ * ICU is normally built such that all of its C++ classes, via their UMemory base,
+ * override operators new and delete to use its internal, customizable,
+ * non-exception-throwing memory allocation functions. (Default value 1 for this macro.)
+ *
+ * This is especially important when the application and its libraries use multiple heaps.
+ * For example, on Windows, this allows the ICU DLL to be used by
+ * applications that statically link the C Runtime library.
+ *
+ * @stable ICU 2.2
+ */
+#ifndef U_OVERRIDE_CXX_ALLOCATION
+#define U_OVERRIDE_CXX_ALLOCATION 1
+#endif
+
+/**
+ * \def U_ENABLE_TRACING
+ * Determines whether to enable tracing.
+ * @internal
+ */
+#ifndef U_ENABLE_TRACING
+#define U_ENABLE_TRACING 0
+#endif
+
+/**
+ * \def U_ENABLE_DYLOAD
+ * Whether to enable Dynamic loading in ICU.
+ * @internal
+ */
+#ifndef U_ENABLE_DYLOAD
+#define U_ENABLE_DYLOAD 1
+#endif
+
+/**
+ * \def U_CHECK_DYLOAD
+ * Whether to test Dynamic loading as an OS capability.
+ * @internal
+ */
+#ifndef U_CHECK_DYLOAD
+#define U_CHECK_DYLOAD 1
+#endif
+
+
+/**
+ * \def U_DEFAULT_SHOW_DRAFT
+ * Do we allow ICU users to use the draft APIs by default?
+ * @internal
+ */
+#ifndef U_DEFAULT_SHOW_DRAFT
+#define U_DEFAULT_SHOW_DRAFT 1
+#endif
+
+/*===========================================================================*/
+/* Custom icu entry point renaming                                           */
+/*===========================================================================*/
+
+/**
+ * \def U_HAVE_LIB_SUFFIX
+ * 1 if a custom library suffix is set.
+ * @internal
+ */
+#ifdef U_HAVE_LIB_SUFFIX
+    /* Use the predefined value. */
+#elif defined(U_LIB_SUFFIX_C_NAME) || defined(U_LIB_SUFFIX_C_NAME_STRING)
+#   define U_HAVE_LIB_SUFFIX 1
+#else
+#   define U_HAVE_LIB_SUFFIX 0
+#endif
+
+/**
+ * \def U_LIB_SUFFIX_C_NAME_STRING
+ * Defines the library suffix as a string with C syntax.
+ * @internal
+ */
+#ifdef U_LIB_SUFFIX_C_NAME_STRING
+    /* Use the predefined value. */
+#elif defined(U_LIB_SUFFIX_C_NAME)
+#   define U_LIB_SUFFIX_C_NAME_STRING #U_LIB_SUFFIX_C_NAME
+#else
+#   define U_LIB_SUFFIX_C_NAME_STRING ""
+#endif
+
+/**
+ * \def U_LIB_SUFFIX_C_NAME
+ * Defines the library suffix with C syntax.
+ * @internal
+ */
+#ifdef U_LIB_SUFFIX_C_NAME
+    /* Use the predefined value. */
+#else
+#   define U_LIB_SUFFIX_C_NAME
+#endif
+
+/* common/i18n library switches --------------------------------------------- */
+
 /**
  * \def UCONFIG_ONLY_COLLATION
  * This switch turns off modules that are not needed for collation.
index afd32b0e58c823dad059385bc81da2721bc6bfdf..cd742ec43babb3a43fcd910f1a47482847eb8b6f 100644 (file)
 /* which are contained in the platform-specific file platform.h             */
 /*==========================================================================*/
 
-#if defined(U_PALMOS)
-#   include "unicode/ppalmos.h"
-#elif !defined(__MINGW32__) && (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64))
-/*
- * platform.h is now also generated by MSVC Solution/Project files
- * from platform.win and should always be included unless you are
- * building stubdata which is built before the platform.h file is
- * generated.
- */
-#ifndef STUBDATA_BUILD
-#   include "unicode/platform.h"
-#endif
-#   include "unicode/pwin32.h"
-#else
-#   include "unicode/ptypes.h" /* platform.h is included in ptypes.h */
-#endif
+#include "unicode/ptypes.h" /* platform.h is included in ptypes.h */
 
 /*
  * ANSI C headers:
  */
 #include <stddef.h>
 
-/*==========================================================================*/
-/* XP_CPLUSPLUS is a cross-platform symbol which should be defined when     */
-/* using C++.  It should not be defined when compiling under C.             */
-/*==========================================================================*/
-
-#ifdef __cplusplus
-#   ifndef XP_CPLUSPLUS
-#       define XP_CPLUSPLUS
-#   endif
-#else
-#   undef XP_CPLUSPLUS
-#endif
-
 /*==========================================================================*/
 /* For C wrappers, we use the symbol U_STABLE.                                */
 /* This works properly if the includer is C or C++.                         */
  * @stable ICU 2.4
  */
 
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
 #   define U_CFUNC extern "C"
 #   define U_CDECL_BEGIN extern "C" {
 #   define U_CDECL_END   }
  * This is used for Visual C++ specific attributes 
  * @internal
  */
-#elif defined(U_WINDOWS) && defined(_MSC_VER) && (_MSC_VER >= 1400)
+#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
 #    define U_ATTRIBUTE_DEPRECATED __declspec(deprecated)
 #else
 #    define U_ATTRIBUTE_DEPRECATED
@@ -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
index 27d4c84da5b678e2df48ae43b682ab5490928350..95f4ef576f1b930332de2ae806501cbfd813fd20 100644 (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.
 *
 ******************************************************************************
 
 #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).
index 1face48bce459effff90f7e3bfc959d5107cf96e..f9641c677a767f35e84955597a289d538aa1e893 100644 (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
 
 /** @} */
 
-
-/*===========================================================================*/
-/* 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                                                     */
 /*===========================================================================*/
 #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
index e53c39f428ed1f71b21d842ca1c5d47bb7015d46..2f259f1c13a4d58484773e07ed1739bf0ace606f 100644 (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 { }
index 2d7febf5f1cbed0c45ada5bfc5c5f585dfdcb85a..c1667c96b9d0aaf9961f95c50927656b3a0cdcdf 100644 (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
 
index 4e7ead05215326f98272ebbf056d257cc8bfa2cd..fa8c8f3aa284146308f523553961e5bf0fce58e3 100644 (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"
 
index bdacef050bd8540caf111139a5f272722f8e1e7e..79a8636f0dff9565760463f3008e19c292b6681f 100644 (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 */
index 3a06ceb9cf4360a7e5fba10b57b2431dbdef04e1..081b38db934e1398b584aafa361364d6bbf71c73 100644 (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 */
index 9fedf989fd389116b38e3c945b97d7236841cbbe..6ebe468d3bc267c69b545569150a5d62471897eb 100755 (executable)
@@ -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
index 62728a3bd4c6b5480806d7a2a936475f6f294e15..455884775fd973dd2ad97f41572d044d510c364f 100644 (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 
index c39b72544569e3eac56c1ef29ec22894e1b3d788..9b338d8387198614bc10a46cf0396332319cbb87 100644 (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@
index ce5d29d741747046850362ec001b90af69368a9a..b2f8c3575990007f94794fc09af9ef37cc5f9a7f 100644 (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),)
index 57cf80501d3c2f177ccf51b2c59d9db56aa3c6c6..0bba48eafe1a732dc62e770d90ad2fc4634c2e5d 100644 (file)
 
 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, '/');
     }
index 22c60061dc9a736d3da864bd3ae6792ff68a8f54..f326e3b9a156f63882998cb1c4c3e3b1d99d16cc 100644 (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)
index ad3555714d1f874d8723af37c3c50ce7643a6bf1..6f5917c2d5ff35e8358c319f7f69c82bea587d42 100644 (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);
 
index 508f1b424783cbde395c2bdd542bd347e0d22ef9..c4e1d88e07bf753749ceebfb4bb376d9d24175b3 100644 (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
 
index f848bc3ee23d01e7577659c8f4926568a5b9fd16..ade425404bde92a80dd7aa2d5e7987ceec9fd668 100644 (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)) {
index 94fc21a6be760e9c943d2da66b8f4ef590cac914..09ab634f0a13be843fd16b627b8cfbc970751efa 100644 (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);
 
index 96bdac06479e4539d5f3e3538c4c3ec177c6404f..098a700d4eb466c6c9c25ce0da803e5f2a53b1e5 100644 (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:
index c1b9f1e369702b9d07cfc3c3654e4b53a515afef..5512780029ca6bff526ab1df8637400f968f96ce 100644 (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
index 748986ff8657daa2aaf6f5e97410651087eb1617..099a30de5e90b3172006608b658dd5629821b586 100644 (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); 
index 20b2bc30a90c62fcdd0da078bc9a792d2cc42adf..f89af082e1aff8b1d5e362bb362e43b9ac416ec3 100644 (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.
index 8fedabd675319ddec1e8a87c92a4c68fc1810ecb..0fda3419bcee60713d6a32c92505e94cbc1a3775 100644 (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
 
index aea8f0a4458c4e4989b67bd13f24d58b93f567b7..39ac8afb62093ff62ab4e9f703e1158710dcff1a 100644 (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
index 4207c52e7e91543ff7ce3e5ab5206ae8c2ffea55..97e730f538bec10f5f82ce82f783f29b1f0064e8 100644 (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
index 7b2f9ac8548949346bbbfc775fdb72c537b53ce7..f4474d8d73cf291a13d9205f6433a95b6ebfb6a8 100644 (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
index fb7de50a812533c430d06d75c171ca9bf3c21e1e..eaa3dd0d72dae9bacba16748904593ebbe8717d8 100644 (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"
 
index e7083e9226ebcc9a7eb88abb7b6b30f70b0fbccc..3c01c0f447d0227f24b2980bd108360f5baf292c 100644 (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 */
index a40f7fd29e4911581114d6d1a7426c8329497f24..130b8776445a9408dcac4f321b7f285e17043883 100644 (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)
index 2f0739f14acec5867948dee4b0e071ace6742058..125bbfe4c6223b763a669fc297b121d57df4a73a 100644 (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
index 0ec153ad249614cad2a287aa68af9731877c14b8..c7e8751da7450b85de924e02237b25c09a9f667a 100644 (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. */
index 400d016e4a41792bec93984b245237ec303e00da..cc720f7797c223a8ba522423e5aa48e157e4ab6b 100644 (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.
  *
index 5e9ec49819d07f7be33faf1dfcea78a4ea052674..6d722e0b75e114150bd9e1448bb734c0e87dbfec 100644 (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)
index 71e37f64503127d0e2864149415c38a2d88a091d..3f11c87a950a98ed2267f07820530eb91fdec219 100644 (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)
index 08a8f77a86eb9fe35b99b477e560dcc5553e0931..795e2f07d0c0cffe44fd156a28c28e508699680b 100644 (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
index acf2442227ab543f3238d1b439a76af1e8826a31..de16093589e3c34fa6ab846b81253d3b0371d870 100644 (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
index 15fae07c16a9a9c58da731ddd18738875e7a1106..4beb90f3468d89a7dcf9d96b2dc27cdfad629f2e 100644 (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`
 
index 168fe2ceb1784411090b10796d6d14f0ce2c8f91..ab09daf0ba3636cfcbc9f9aa3186bdf1932bd35d 100644 (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)$@ $^
index 33725cd352a0263fc8d7cb09381f8ecef872915d..67dd11fdba56b502f80b2757abd3c580dac8dc75 100644 (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)"'
index afaffb27d4884bf0af0cebf6388439b39cb345c9..fb5f5c07fceeed98547a887c73e2b1393a8f80be 100644 (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
 
index 1b9d5cedf5c9be4066b45425e49faa4e731d131c..52035fa44f40e4285e5482a67604cfaf8210aabb 100644 (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) 
index a09b2392d938021d75b108385af8fee1dae61ba9..eb79980de9f827f752caa8b8e0c33c4142312938 100644 (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";
index 3be7e3cc92885b09bc765fadb7c5e29f83b2bc85..948e1ca3d533e81eff3cce821ac6f179710d251d 100644 (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
index 9b337322b9c28f73a4679010f7b53846584efe47..b5ebf4e48dd04efeada287ec47a9e4c9400ff064 100644 (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__); 
index 561fe4d3c7fc5c5bea238103b18010462de3003d..799ef842a4c5df4b7f3b7a55def3f4b86c923fa1 100644 (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,
index a936bc245fa698ccf39de17d42d08c3769adcf35..d2188113b5ae237578fd333aed917b05808e44fa 100644 (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;
index af87cf8e8bd8b0ac140d84c867ea95823571e11b..7bdc4e961a5b91e44f65ff0c69311f539f8bb5d1 100644 (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
index 95502b7f8b5d31267fc1a63c982d4c964090a6c5..81c5f4a68dac4fab00b01331783309770597461c 100644 (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
index fb1e67a02bfd51badeb6ac8da2fc84b69cfb5084..cf38e6b9d502ed78b53a7c3bf7f9242659684cb2 100644 (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)
index 85202f975f6ad2c74bf596637070e7b5e9f46875..3cb949189bb3df729ff315e6d2e9adcb77debb4e 100644 (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
 }
index 508368c70f5fa89c588905605ca9d374c283a4cd..c6a3228e7cd727d5b9833e4f2197baa908f25ee7 100644 (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);
index 531c883a137843e9a29124d513ce33c46b51f5f7..c0b177091d2d048104649c5fbdc15be111f9d209 100644 (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
 
index c2c962a7968ef7f61f5b5dd784fcc6ee0e19bbc7..e4d8d3804e58564824c01479774e732da4c25209 100644 (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));
index 2192231fcb7bb373255f27f17e773cb7fcf9b21b..214b7b7c130ff4367537db64b5f6bcd3a0ef16c3 100644 (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");
index 110e2e7cbd701d079b8ab3bc882685b38680c405..befd64801c70ef5427385e6c6c3972196bb39949 100644 (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) {
index 323de8569274c76f543e8b1b5fdb7dba9a65c51c..2817ab2cf856aaa7d12ff9e9e26ae7bc10c7a19d 100644 (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.
  ********************************************************************/
 
 #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)
 #define __EXTENSIONS__
 #endif
 
-#if defined(OS390)
+#if U_PLATFORM == U_PF_OS390
 #include <sys/types.h>
 #endif
 
-#if !defined(OS390)
+#if U_PLATFORM != U_PF_OS390
 #include <signal.h>
 #endif
 
 #include "unicode/calendar.h"
 #include "ucaconf.h"
 
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
 #define HAVE_IMP
 
 #   define VC_EXTRALEAN
@@ -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);
index 8bb5e226c8cfe4888c701c5775c6eec0cccbe149..1f7c81d4ae56694445e576f5d418bb96cdaf5e00 100644 (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"));
index 569540060231528ff013b0dee8a5abc5ca322d07..4074bcaee81ea7e18bf172dfba9cb4be6e628c6e 100644 (file)
 #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
 
 #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
 
index d05b96bbb9ac266eff8cae22ae41ac61074087a9..9e417a3c40cf663634083f49d2b456d9996a14e2 100644 (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);
 
index 222225a9c35c02ed4c095ad5aab4f82fb7676642..009e3802f916a7db1fe3efb0dbbeec40d4cc4974 100644 (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.");
     }
index 6efcd81634012874b445a1ca3f66dfd78d4e3003..3f5e9cf0e374e980fd31280fcf4d171e6fb49182 100644 (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
index ce90de069811ef019a92a30da002f8ed00fe17f0..b8b0823ec135c133061aabfd22294986e56ce066 100644 (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 */
index b9b3e637488916d6ee578379f9b7696a4a1270a0..54ef0d12aa3e99283bdbd76157ce1398c7418c23 100644 (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
index a18d2a2a68234fd12055b9abc8755d703ef0b875..d09c1fec87c3efbaef575dfb2b0b4f5565dea1e3 100644 (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 */
index 411969ad9ef23cdcebf3eb84c1a963319152d827..440c98712688b1bccba9aa32c154fab852560442 100644 (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
index 760e9feea2b3b85efedeae080abca761d9952a8d..0b7bd6d7a9befa01fd3f66ac7bf400b9efe193e4 100644 (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 */
index 3d68f0e1ee69fce8c4e39e583a1052e9b3dc5a38..a0003059cdfef1366cb24ec2cc298e7243eef7c9 100644 (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
index 65e12b9053c3837d27005666d3dfacd1c41df7d8..9095f11b49f299454141cb6fe4a8a1030f696b8e 100644 (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)
index 794da82a409f5f77d8d3705a88772f5735aaeebe..a821636c77e92106e2114c13eb7af4b5a40321d5 100644 (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"
index 62138995d6d2140119bb4705883dafcbab9c0cf2..c989adb7ca5610c648e62d2e9bec80788ec65b07 100644 (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@
 
index 9f066ca8c99c72835d516b2d72087a028c499544..40d1e8f43eb07141088ea0cb8708be7f3774b26e 100644 (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
 
index f83f9212e351efd505af9a0d480a2cef5ff75012..bd5888fc7c5d5f2eb65cbc1398f92ab77a5ee349 100644 (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
 
index 8c3bbad509e4a76ff086cb67c627ed92c1797b90..2a87c43780b04a198403b82157f66e51ec7785dc 100644 (file)
@@ -37,7 +37,7 @@ using namespace std;
 
 //  Stubs for Windows API functions when building on UNIXes.
 //
-#if defined(U_WINDOWS)
+#if U_PLATFORM_USES_ONLY_WIN32_API
 // do nothing
 #else
 #define _UNICODE
index eba8e388dcb11508e9cd0ade4ffea7a907192052..3e651de497e3ec8f42efe6831eeda2c20af17d8d 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/ubrkperf
-## Copyright (c) 2001-2010, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = DateFmtPerf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_builddir)/i18n -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_builddir)/i18n -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = DateFmtPerf.o
index 610b90d84ca87936f0c7e49837cfd271cb0a3179..9276a78f032d65e9e306176310cc6fbd35cdc39e 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/charperf
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = charperf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = charperf.o
index a59327124ac6d4959bb4e92483611b11b65a59d3..81e324872d6bdf431aba80f4977eb99d11feeaf6 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/collationperf
-## Copyright (c) 2001-2009, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = collperf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = collperf.o
index fcc1615b3fba2e2e4401673b626de1fd2befdd56..b2dce6815b3dd28d8708bb15fd9b48de3203e484 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/collperf
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = collperf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = collperf.o
index fd30f50bdea49bee655079704ae70a7fab92234c..a3b74679f553f9c75ad333de6c0e6c7729f08fae 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
 * COPYRIGHT:
-* Copyright (C) 2001-2006 IBM, Inc.   All Rights Reserved.
+* Copyright (C) 2001-2011 IBM, Inc.   All Rights Reserved.
 *
 ********************************************************************/
 
@@ -575,7 +575,7 @@ public:
             locale = "en_US";   // set default locale
         }
 
-        //#ifdef U_WINDOWS
+        //#if U_PLATFORM_USES_ONLY_WIN32_API
         if (options[i].doesOccur) {
             char *endp;
             int tmp = strtol(options[i].value, &endp, 0);
index b2ec30bc69822ea33e168345c3bd119086e7f760..538c49b16c6101c1ede2af1750da2d79f09d823b 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/collperf
-## Copyright (c) 2001-2007, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = collperf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = convperf.o
index beb4fda27494298625ba30dad0a87005679a1428..931a1a817d7a637067b18c3d13a53924cb829a1a 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/dicttrieperf
-## Copyright (c) 2001-2010, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = dicttrieperf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = dicttrieperf.o
index 8b35cab04654b2f9e45fdce7287dfe99745eda57..e56be510d27f8f74c4eba09ff7ff9902329b49cc 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/normperf
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = normperf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = normperf.o
index b100e69aa4fb5e6b662677a3ebbb8aeb7639d549..6be40f4351eecce4de19279863170d1725f28253 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-* Copyright (c) 2010,International Business Machines
+* Copyright (c) 2010-2011,International Business Machines
 * Corporation and others.  All Rights Reserved.
 **********************************************************************
 **********************************************************************
@@ -39,7 +39,7 @@ using namespace std;
 
 //  Stubs for Windows API functions when building on UNIXes.
 //
-#if defined(U_WINDOWS)
+#if U_PLATFORM_USES_ONLY_WIN32_API
 // do nothing
 #else
 #define _UNICODE
index 6a43a7727be5e41c2e7d0be6b29adab793c9836a..ce2e90ca06dffce9e6e32e24277150eb3938ac53 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-* Copyright (c) 2002-2006, International Business Machines
+* Copyright (c) 2002-2011, International Business Machines
 * Corporation and others.  All Rights Reserved.
 **********************************************************************
 **********************************************************************
@@ -16,7 +16,7 @@
 
 //  Stubs for Windows API functions when building on UNIXes.
 //
-#if defined(U_WINDOWS)
+#if U_PLATFORM_USES_ONLY_WIN32_API
 // do nothing
 #else
 #define _UNICODE
@@ -315,7 +315,7 @@ int32_t ICUIsNormalized(const UChar* src,int32_t srcLen, UNormalizationMode mode
 }
 #endif
 
-#if defined(U_WINDOWS)
+#if U_PLATFORM_HAS_WIN32_API
 
 int32_t WinNormNFD(const UChar* src, int32_t srcLen, UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return FoldStringW(MAP_COMPOSITE,src,srcLen,dest,dstLen);
index bd03d38e5794b4c67d9a3a869eb00b73a9bf74b4..b2d93167bf33074f9e0030dd30cf801474b76f25 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/strsrchperf
-## Copyright (c) 2008, International Business Machines Corporation and
+## Copyright (c) 2008-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = strsrchperf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = strsrchperf.o
index e255c38940e5c27714af9fbefeb1948f0fe1dd85..6aa5ea85921dd5170931f4448c36fcb9aba8e162 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/ubrkperf
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = ubrkperf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = ubrkperf.o
index 9a090ee5facc1731734ae4e72638da0055d29d54..cd84edf922779cb52e5d4205ae70837a60ec10df 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT:
- * Copyright (C) 2001-2008 International Business Machines Corporation
+ * Copyright (C) 2001-2011 International Business Machines Corporation
  * and others. All Rights Reserved.
  *
  ********************************************************************/
@@ -21,7 +21,7 @@
 
 
 #if 0
-#ifdef U_DARWIN
+#if U_PLATFORM_IS_DARWIN_BASED
 #include <ApplicationServices/ApplicationServices.h>
 enum{
   kUCTextBreakAllMask = (kUCTextBreakClusterMask | kUCTextBreakWordMask | kUCTextBreakLineMask)
@@ -83,7 +83,7 @@ void doForwardTest() {
 
     elapsedTime = timeGetTime()-startTime;
   } else if(opt_mac) {
-#ifdef U_DARWIN
+#if U_PLATFORM_IS_DARWIN_BASED
     createMACBrkIt();
     UniChar* filePtr = text;
     OSStatus status = noErr;
index 4c55a73976c385b7f9f007579296f26789687245..0d9e98730bb2c47739b777253331cb711c0d97dd 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-* Copyright (c) 2002-2005, International Business Machines
+* Copyright (c) 2002-2011, International Business Machines
 * Corporation and others.  All Rights Reserved.
 **********************************************************************
 **********************************************************************
@@ -104,13 +104,8 @@ public:
 };
 
 class DarwinBreakFunction : public UPerfFunction {
-#ifdef U_DARWIN
 public:
   virtual void call(UErrorCode *status) {};
-#else
-public:
-  virtual void call(UErrorCode *status) {};
-#endif
 };
 
 class BreakIteratorPerformanceTest : public UPerfTest {
index 4ab8190f5ba42133aacf91407f420a79a53b6b5f..5700c26a8b4ebb4bf5983f232858661e8c95823d 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT:
- * Copyright (C) 2001-2005 IBM, Inc.   All Rights Reserved.
+ * Copyright (C) 2001-2011 IBM, Inc.   All Rights Reserved.
  *
  ********************************************************************/
 /********************************************************************************
@@ -69,7 +69,7 @@ const char gUsageString[] =
 #include <unicode/brkiter.h>
 
 
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
 #include <windows.h>
 #else
 //
@@ -165,7 +165,7 @@ int32_t textSize = 0;
 
 
 
-#ifdef U_DARWIN
+#if U_PLATFORM_IS_DARWIN_BASED
 #include <ApplicationServices/ApplicationServices.h>
 enum{
   kUCTextBreakAllMask = (kUCTextBreakClusterMask | kUCTextBreakWordMask | kUCTextBreakLineMask)
@@ -309,7 +309,7 @@ void doForwardTest() {
 
     elapsedTime = timeGetTime()-startTime;
   } else if(opt_mac) {
-#ifdef U_DARWIN
+#if U_PLATFORM_IS_DARWIN_BASED
     createMACBrkIt();
     UniChar* filePtr = text;
     OSStatus status = noErr;
index 07c62d657da0b452faa8c4ebdb2a3c82a580da5d..12231b84c8d833ec8bdef521d335e85c5c4b85b0 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/unisetperf
-## Copyright (c) 2001-2007, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = unisetperf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = unisetperf.o
index 3e7373047487ba536eea5b6da01a99412aeeacd0..80ee79b45750ea815328da3c57a6c2bbff151b58 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/usetperf
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = usetperf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = usetperf.o bitset.o
index 654d4a2f6eabcab1cae39605cef0bcdac7a47475..4898b1bf834369d4af0807cd4d7300206816b33b 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/ustrperf
-## Copyright (c) 2001-2008, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = stringperf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = stringperf.o
index dbaf1ab43163ed6ea2f3e320debf4e9d2035719e..c6694ccc152e81b6e8af4c6d74e35158dcc4ad91 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/utfperf
-## Copyright (c) 2001-2006, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = utfperf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = utfperf.o
index e9098ebe5630b3e2f12b7832c275f2f5f0698e1e..313c7c7eb6efacb6fd06cfa8bfba850227f5eef4 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/perf/utrie2perf
-## Copyright (c) 2001-2008, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -19,7 +19,7 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = utrie2perf
 
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
 LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
 
 OBJECTS = utrie2perf.o
index 9499b2c942e82510fa76d24a6aa923783299381c..2bf2b68840a1b8864ea77ec15c07260ecfc0a6d0 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/testmap
-## Copyright (c) 2003-2006, International Business Machines Corporation and
+## Copyright (c) 2003-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -20,7 +20,7 @@ CLEANFILES = *~ $(DEPS)
 TARGET = testmap$(EXEEXT)
 
 #DEFS = @DEFS@
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n 
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n 
 #CFLAGS += @CFLAGS@
 #CXXFLAGS = @CXXFLAGS@
 
index 63cc7b7f6327f5abecf0d01f7efeb6a5e3c61556..0fada25f601a331c0ad8915335372089b97ae8ac 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/thaitest
-## Copyright (c) 2003, International Business Machines Corporation and
+## Copyright (c) 2003-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -20,7 +20,7 @@ CLEANFILES = *~ $(DEPS)
 TARGET = thaitest$(EXEEXT)
 
 DEFS = @DEFS@
-CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n 
+CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n 
 #CFLAGS += @CFLAGS@
 #CXXFLAGS = @CXXFLAGS@
 
index 8d268925fbc055f101ad7d48ab86b1302fef387e..4014a7fec586e7d5d41ffd4c82ec085dc4d35759 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - test/threadtest
-## Copyright (c) 2001, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -23,7 +23,7 @@ CLEANFILES = *~ $(DEPS)
 TARGET = threadtest
 
 DEFS = @DEFS@
-CPPFLAGS = @CPPFLAGS@ -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/i18n 
+CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/common -I$(top_srcdir)/i18n 
 CFLAGS = @CFLAGS@
 CXXFLAGS = @CXXFLAGS@
 ENABLE_RPATH = @ENABLE_RPATH@
index 7891a888f19205de76e556f24ad147102a01f895..bece6f2382ee6eb35d953f4229a86fc0b8f3640e 100644 (file)
@@ -1,6 +1,6 @@
 //
 //********************************************************************
-//   Copyright (C) 2002-2005, International Business Machines
+//   Copyright (C) 2002-2011, International Business Machines
 //   Corporation and others.  All Rights Reserved.
 //********************************************************************
 //
@@ -32,7 +32,7 @@ extern  AbstractThreadTest *createConvertTest();
 //   Windows specific code for starting threads
 //
 //------------------------------------------------------------------------------
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
 
 #include "Windows.h"
 #include "process.h"
index 4f96959f0046c0d7cd59c805b9decec0a0ed5752..3df9af6ed2439d80f303b89aae7c0f9722323939 100644 (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.
 #
 #******************************************************************************
@@ -43,9 +43,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 -I$(srcdir)/../toolutil -I$(srcdir) $(LIBCPPFLAGS) $(CPPFLAGSCTESTFW)
 DEFS += -DT_CTEST_IMPLEMENTATION
 LDFLAGS += $(LDFLAGSCTESTFW)
index 6deb1cdff09fbd33ec23ffed7dac5be165122324..9c4a72ea7382b773e84530c5d2242561b5a183e9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *****************************************************************************************
- *   Copyright (C) 2004-2007, International Business Machines
+ *   Copyright (C) 2004-2011, International Business Machines
  *   Corporation and others.  All Rights Reserved.
  *****************************************************************************************
  */
@@ -16,7 +16,7 @@
     #define T_CTEST_IMPORT
 #endif
 
-#if defined(U_WINDOWS)
+#if defined(_MSC_VER)
 #define T_CTEST_EXPORT2 __cdecl
 #else
 #define T_CTEST_EXPORT2
index b59867cb006520622361b115a7dc2e598703b71f..fb9f049d740297b2c398220a0106512af245568c 100644 (file)
 
 #include "unicode/utypes.h"
 
-#if defined(U_WINDOWS)
+#if U_PLATFORM_HAS_WIN32_API
 #   define VC_EXTRALEAN
 #   define WIN32_LEAN_AND_MEAN
 #   include <windows.h>
 #else
-#   if defined(OS390)
+#   if U_PLATFORM == U_PF_OS390
 #     define __UU  /* Universal Unix - for struct timeval */
 #   endif
 #   include <time.h>
@@ -88,7 +88,7 @@
  *                  }
  *
  *                  retVal= fn(fileLines[line].name,len,dest,destCapacity,&error);
- *      #if defined(U_WINDOWS)
+ *      #if U_PLATFORM_HAS_WIN32_API
  *                  if(retVal==0 ){
  *                      fprintf(stderr,"Normalization of string in Windows API failed for mode %s. ErrorNo: %i at line number %i\n",mode,GetLastError(),line);
  *                      return 0;
@@ -160,7 +160,7 @@ typedef struct UTimer UTimer;
 typedef void FuntionToBeTimed(void* param);
 
 
-#if defined(U_WINDOWS)
+#if U_PLATFORM_HAS_WIN32_API
 
     struct UTimer{
         LARGE_INTEGER start;
index 5884cef323d3a8a8e8c49c5a8348d16edb2574d9..77182d17d3c0f0817b7d664d35e854c811333461 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/genbrk
-## Copyright (c) 2002-2006 International Business Machines Corporation and
+## Copyright (c) 2002-2011 International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -26,9 +26,6 @@ CLEANFILES = *~ $(DEPS) $(MAN_FILES)
 ## Target information
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
index 41913b13b2ed7125455ac94b555693b00a5b5a07..fe6b60fad7de47c72243284097c4edd6858f1f9b 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/genccode
-## Copyright (c) 1999-2008, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 ## Steven R. Loomis
 
@@ -27,9 +27,6 @@ CLEANFILES = *~ $(DEPS) $(MAN_FILES)
 ## Target information
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
index 12520c3dc9791d64e1c693cfecb3defbd9a62479..98e9bb33d5eeaec9ea0bf9c97ce9b178dca0e26c 100644 (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.
  *******************************************************************************
  *   file name:  gennames.c
@@ -19,7 +19,7 @@
 
 #include "unicode/utypes.h"
 
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
 #   define VC_EXTRALEAN
 #   define WIN32_LEAN_AND_MEAN
 #   define NOUSER
@@ -30,7 +30,7 @@
 #include <time.h>
 #endif
 
-#ifdef U_LINUX
+#if U_PLATFORM_IS_LINUX_BASED
 #   define U_ELF
 #endif
 
@@ -57,7 +57,7 @@
 #include "uoptions.h"
 #include "pkg_genc.h"
 
-#if defined(U_WINDOWS) || defined(U_ELF)
+#if U_PLATFORM_HAS_WIN32_API || defined(U_ELF)
 #define CAN_GENERATE_OBJECTS
 #endif
 
index b966e4ed7ec543a46c0d36167b5ea9b4579c2a99..0185606418490aac2024b640e44b2a5ec87aa54c 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/gencfu
-## Copyright (c) 2009 International Business Machines Corporation and
+## Copyright (c) 2009-2011 International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -26,9 +26,6 @@ CLEANFILES = *~ $(DEPS) $(MAN_FILES)
 ## Target information
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
index 2c6aafeb8383afc0dffb0ea8c7bb3676244f5f2b..8a758d13dc7936fa4731f2ea10722363da81d32b 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/gencmn
-## Copyright (c) 1999-2008, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 ## Steven R. Loomis
 
@@ -27,9 +27,6 @@ CLEANFILES = *~ $(DEPS) $(MAN_FILES)
 ## Target information
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
index c4c2ab56be8581bbfe70535c3c9e3db6e8e70ca6..985f1e3a606507f7637607b3010c7c235288c285 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/gencnval
-## Copyright (c) 1999-2005, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 ## Steven R. Loomis
 
@@ -27,9 +27,6 @@ CLEANFILES = *~ $(DEPS) $(MAN_FILES)
 ## Target information
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
index daefb61b37f47fae6f46c161622d8030a59bb59a..f202702dec5d621f7c8fa65bbd0d2f4793352073 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/genctd
-## Copyright (c) 2002-2006 International Business Machines Corporation and
+## Copyright (c) 2002-2011 International Business Machines Corporation and
 ## others. All Rights Reserved.
 
 ## Source directory information
@@ -26,9 +26,6 @@ CLEANFILES = *~ $(DEPS) $(MAN_FILES)
 ## Target information
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
index f46e4664549c4958afd8fafdc288401ca904de83..b8f926a75321e4aeb4b33788d9142430a10b1fc5 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/gennorm2
-## Copyright (c) 2009-2010, International Business Machines Corporation and
+## Copyright (c) 2009-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 ## Steven R. Loomis/Markus W. Scherer
 
@@ -22,9 +22,6 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
index 83a67db8a6ac9295c3b97a972e032d21074c6ff9..ae05bed8a6c52d54c4f3a099d6ed94ae2a1530ff 100644 (file)
@@ -1,6 +1,6 @@
 #################################################################################
 ## Makefile.in for ICU - tools/genrb                                            #
-## Copyright (c) 1999-2009, International Business Machines Corporation and     #
+## Copyright (c) 1999-2011, International Business Machines Corporation and     #
 ## others. All Rights Reserved.                                                 #
 #################################################################################
 
@@ -30,9 +30,6 @@ CLEANFILES = *~ $(MAN_FILES) $(DEPS) $(DERB_DEPS)
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 DERB = $(BINDIR)/$(DERB_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
index 095304fe389d177958aa5d59be6af5524194d443..65db73eba5051983051ef3cfd40fda00eea1737d 100644 (file)
@@ -30,7 +30,7 @@
 #include <stdio.h>
 #include <ctype.h>
 
-#if defined(U_WINDOWS) || defined(U_CYGWIN) || defined(U_MINGW)
+#if U_PLATFORM_HAS_WIN32_API
 #include <io.h>
 #include <fcntl.h>
 #define USE_FILENO_BINARY_MODE 1
@@ -237,7 +237,7 @@ main(int argc, char* argv[]) {
 
         if (!(fromICUData = !uprv_strcmp(inputDir, "-"))) {
             UBool absfilename = *arg == U_FILE_SEP_CHAR;
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
             if (!absfilename) {
                 absfilename = (uprv_strlen(arg) > 2 && isalpha(arg[0])
                     && arg[1] == ':' && arg[2] == U_FILE_SEP_CHAR);
@@ -293,7 +293,7 @@ main(int argc, char* argv[]) {
 
             if (tostdout) {
                 out = stdout;
-#if defined(U_WINDOWS) || defined(U_CYGWIN) || defined(U_MINGW)
+#if U_PLATFORM_HAS_WIN32_API
                 if (setmode(fileno(out), O_BINARY) == -1) {
                     fprintf(stderr, "%s: couldn't set standard output to binary mode\n", pname);
                     return 4;
index be170ac41949eff67478577bc2a280f1c0c4a3bf..4da97bd1d86841960bed7141f36c2a75af5d072b 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/gensprep
-## Copyright (c) 2001-2005, International Business Machines Corporation and
+## Copyright (c) 2001-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 ## Steven R. Loomis/Markus W. Scherer
 
@@ -27,9 +27,6 @@ CLEANFILES = *~ $(DEPS) $(MAN_FILES)
 ## Target information
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
index 6d8e7eb1d26741233c677cc852f981ec64fd2d5f..7b70a1c0c48bb188159a0b5c3afc51cf07eb0bf7 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/gentest
-## Copyright (c) 1999-2008, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 ## Madhu Katragadda
 
@@ -20,9 +20,6 @@ CLEANFILES = *~ $(DEPS)
 ## Target information
 TARGET = gentest$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common 
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil -I$(top_srcdir)/tools/ctestfw 
 CPPFLAGS+= -I$(top_srcdir)/i18n
 LIBS = $(LIBCTESTFW) $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
index 18b58f7b7ca943d895247a5a893e224f5c4c8e3e..6a3f026e29db80d20099fd345dd26edb783b3bd1 100644 (file)
@@ -20,9 +20,6 @@ CLEANFILES = *~ $(DEPS) $(PLUGIN_OBJECTS) $(PLUGINFILE) $(PLUGIN)
 ## Target information
 TARGET = icuinfo$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common 
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil -I$(top_srcdir)/tools/ctestfw 
 CPPFLAGS+= -I$(top_srcdir)/i18n
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
@@ -36,7 +33,7 @@ DEPS = $(OBJECTS:.o=.d)
 
 ICUINFO_OPTS=-i ../../data/out/build/$(ICUDATA_PLATFORM_NAME)
 
-CPPFLAGS+=  "-DU_PLATFORM=\"@platform@\""  "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@CC@\"" "-DU_CXX=\"@CXX@\""
+CPPFLAGS+=  "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@CC@\"" "-DU_CXX=\"@CXX@\""
 
 ## List of phony targets
 .PHONY : all all-local install install-local clean clean-local         \
index 4144570f1bc213172b96e79598883d9eddd5c243..6b93f4ff4af21cda6480c2ba8a6e56ea5684782e 100644 (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,16 +60,12 @@ static void do_init() {
  */
 static const char *getPlatform()
 {
-#if defined(U_PLATFORM)
-       return U_PLATFORM;
-#elif defined(U_WINDOWS)
-       return "Windows";
-#elif defined(U_PALMOS)
-       return "PalmOS";
-#elif defined(_PLATFORM_H)
-       return "Other (POSIX-like)";
+#if U_PLATFORM_HAS_WIN32_API
+    return "Windows";
+#elif U_PLATFORM == U_PF_UNKNOWN
+    return "unknown"
 #else
-       return "unknown"
+    return "Other (POSIX-like)";
 #endif
 }
 
@@ -78,7 +74,7 @@ void cmd_millis()
   printf("Milliseconds since Epoch: %.0f\n", uprv_getUTCtime());
 }
 
-void cmd_version(UBool noLoad)
+void cmd_version(UBool noLoad, UErrorCode &errorCode)
 {
     UVersionInfo icu;
     char str[200];
@@ -92,8 +88,47 @@ void cmd_version(UBool noLoad)
     printf("Compiled-Unicode-Version: %s\n", U_UNICODE_VERSION);
     u_getUnicodeVersion(icu);
     u_versionToString(icu, str);
-    printf("Runtime-Unicode-Version: %s\n", U_UNICODE_VERSION);
+    printf("Runtime-Unicode-Version: %s\n", str);
     printf("Platform: %s\n", getPlatform());
+    printf("U_PLATFORM: %d\n", U_PLATFORM);
+
+    union {
+        uint8_t byte;
+        uint16_t word;
+    } u;
+    u.word=0x0100;
+    if(U_IS_BIG_ENDIAN==u.byte) {
+        printf("U_IS_BIG_ENDIAN: %d\n", U_IS_BIG_ENDIAN);
+    } else {
+        fprintf(stderr, "  error: U_IS_BIG_ENDIAN=%d != %d=actual 'is big endian'\n",
+                U_IS_BIG_ENDIAN, u.byte);
+        errorCode=U_INTERNAL_PROGRAM_ERROR;
+    }
+
+    if(U_SIZEOF_WCHAR_T==sizeof(wchar_t)) {
+        printf("U_SIZEOF_WCHAR_T: %d\n", U_SIZEOF_WCHAR_T);
+    } else {
+        fprintf(stderr, "  error: U_SIZEOF_WCHAR_T=%d != %d=sizeof(wchar_t)\n",
+                U_SIZEOF_WCHAR_T, (int)sizeof(wchar_t));
+        errorCode=U_INTERNAL_PROGRAM_ERROR;
+    }
+
+    int charsetFamily;
+    if('A'==0x41) {
+        charsetFamily=U_ASCII_FAMILY;
+    } else if('A'==0xc1) {
+        charsetFamily=U_EBCDIC_FAMILY;
+    } else {
+        charsetFamily=-1;  // unknown
+    }
+    if(U_CHARSET_FAMILY==charsetFamily) {
+        printf("U_CHARSET_FAMILY: %d\n", U_CHARSET_FAMILY);
+    } else {
+        fprintf(stderr, "  error: U_CHARSET_FAMILY=%d != %d=actual charset family\n",
+                U_CHARSET_FAMILY, charsetFamily);
+        errorCode=U_INTERNAL_PROGRAM_ERROR;
+    }
+
 #if defined(U_BUILD)
     printf("Build: %s\n", U_BUILD);
 #if defined(U_HOST)
@@ -298,19 +333,19 @@ main(int argc, char* argv[]) {
       cmd_listplugins();
       didSomething = TRUE;
     }
-    
+
     if(options[3].doesOccur) {
-      cmd_version(FALSE);
+      cmd_version(FALSE, errorCode);
       didSomething = TRUE;
     }
-        
+
     if(options[6].doesOccur) {  /* 2nd part of version: cleanup */
       cmd_cleanup();
       didSomething = TRUE;
     }
-        
+
     if(!didSomething) {
-      cmd_version(FALSE);  /* at least print the version # */
+      cmd_version(FALSE, errorCode);  /* at least print the version # */
     }
 
     return U_FAILURE(errorCode);
index 9b67b489201e28866448c3e7f65ddc4c8c3d693d..a8cd5a4b6c79232801c9f1a16930a7f1495e1225 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/icupkg
-## Copyright (c) 1999-2006, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 ## Steven R. Loomis
 
@@ -26,9 +26,6 @@ CLEANFILES = *~ $(DEPS) $(MAN_FILES)
 ## Target information
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
index d2a3ac4e17ec0bc9a4e7bcf6c08be9b17c062c86..e30d3d74f78061758dff7f2e43c72bf535cb738c 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/icuswap
-## Copyright (c) 1999-2008, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 ## Steven R. Loomis
 
@@ -26,9 +26,6 @@ CLEANFILES = *~ $(DEPS) $(MAN_FILES)
 ## Target information
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
index 365401e249695bc18e26f40b8d15c344cb10be18..f0659e07d73de39a56cd2b9fe312f7597702ac21 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/makeconv
-## Copyright (c) 1999-2005, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 ## Stephen F. Booth
 
@@ -26,9 +26,6 @@ CLEANFILES = *~ $(DEPS) $(MAN_FILES)
 ## Target information
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
 
index 1fc6fa51a0e2872f1a1785b4c38ba2b105cf1334..04fe636e0d1c69b70c2a448836a4dbfd32dd0b78 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile.in for ICU - tools/pkgdata
-## Copyright (c) 1999-2009, International Business Machines Corporation and
+## Copyright (c) 1999-2011, International Business Machines Corporation and
 ## others. All Rights Reserved.
 ## Steven R. Loomis
 
@@ -30,9 +30,6 @@ endif
 ## Target information
 TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
 
-ifneq ($(top_builddir),$(top_srcdir))
-CPPFLAGS += -I$(top_builddir)/common
-endif
 CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil
 DEFS += -DUDATA_SO_SUFFIX=\".$(SO)\" -DSTATIC_O=\"$(STATIC_O)\"
 LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
index a7393572cdbc65e29d33d9522ce6a0f03f7bacb9..444248d925c8f9bccb1d250dbe3cb5cb4f2291e4 100644 (file)
@@ -30,7 +30,7 @@
 #include "unicode/utypes.h"
 
 #if U_HAVE_POPEN
-#if (defined(U_CYGWIN) || defined(U_MINGW)) && defined(__STRICT_ANSI__)
+#if (U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(__STRICT_ANSI__)
 /* popen/pclose aren't defined in strict ANSI on Cygwin and MinGW */
 #undef __STRICT_ANSI__
 #endif
@@ -63,20 +63,20 @@ U_CDECL_BEGIN
 #include "pkgtypes.h"
 U_CDECL_END
 
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
 #ifdef __GNUC__
 #define WINDOWS_WITH_GNUC
 #else
 #define WINDOWS_WITH_MSVC
 #endif
 #endif
-#if !defined(WINDOWS_WITH_MSVC) && !defined(U_LINUX)
+#if !defined(WINDOWS_WITH_MSVC) && !U_PLATFORM_IS_LINUX_BASED
 #define BUILD_DATA_WITHOUT_ASSEMBLY
 #endif
-#if defined(WINDOWS_WITH_MSVC) || defined(U_LINUX)
+#if defined(WINDOWS_WITH_MSVC) || U_PLATFORM_IS_LINUX_BASED
 #define CAN_WRITE_OBJ_CODE
 #endif
-#if defined(U_CYGWIN) || defined(CYGWINMSVC)
+#if U_PLATFORM == U_PF_CYGWIN || defined(CYGWINMSVC)
 #define USING_CYGWIN
 #endif
 
@@ -86,7 +86,7 @@ U_CDECL_END
  * the data to generate the final data library. This can
  * increase the performance of the pkdata tool.
  */
-#if defined(OS400)
+#if U_PLATFORM == U_PF_OS400
 #define USE_SINGLE_CCODE_FILE
 #endif
 
@@ -154,7 +154,7 @@ static struct {
     const char *desc;
 } modes[] = {
         { "files", 0,           "Uses raw data files (no effect). Installation copies all files to the target location." },
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
         { "dll",    "library",  "Generates one common data file and one shared library, <package>.dll"},
         { "common", "archive",  "Generates just the common file, <package>.dat"},
         { "static", "static",   "Generates one statically linked library, " LIB_PREFIX "<package>" UDATA_LIB_SUFFIX }
@@ -235,7 +235,7 @@ enum {
     LIB_FILE_VERSION_MAJOR,
     LIB_FILE_VERSION,
     LIB_FILE_VERSION_TMP,
-#ifdef U_CYGWIN
+#if U_PLATFORM == U_PF_CYGWIN
     LIB_FILE_CYGWIN,
        LIB_FILE_CYGWIN_VERSION,
 #endif
@@ -505,7 +505,7 @@ static int runCommand(const char* command, UBool specialHandling) {
     }
 
     if (!specialHandling) {
-#if defined(USING_CYGWIN) || defined(OS400)
+#if defined(USING_CYGWIN) || U_PLATFORM == U_PF_OS400
         if ((len + BUFFER_PADDING_SIZE) >= SMALL_BUFFER_MAX_SIZE) {
             cmd = (char *)uprv_malloc(len + BUFFER_PADDING_SIZE);
         } else {
@@ -514,7 +514,7 @@ static int runCommand(const char* command, UBool specialHandling) {
 #ifdef USING_CYGWIN
         sprintf(cmd, "bash -c \"%s\"", command);
 
-#elif defined(OS400)
+#elif U_PLATFORM == U_PF_OS400
         sprintf(cmd, "QSH CMD('%s')", command);
 #endif
 #else
@@ -647,7 +647,7 @@ static int32_t pkg_executeOptions(UPKGOptions *o) {
                 }
             }
 
-#ifndef OS400
+#if U_PLATFORM != U_PF_OS400
             /* Certain platforms have different library extension ordering. (e.g. libicudata.##.so vs libicudata.so.##)
              * reverseExt is FALSE if the suffix should be the version number.
              */
@@ -724,7 +724,7 @@ static int32_t pkg_executeOptions(UPKGOptions *o) {
                 }
 #ifdef CAN_WRITE_OBJ_CODE
                 writeObjectCode(datFileNamePath, o->tmpDir, o->entryName, NULL, NULL, gencFilePath);
-#ifdef U_LINUX
+#if U_PLATFORM_IS_LINUX_BASED
                 result = pkg_generateLibraryFile(targetDir, mode, gencFilePath);
 #elif defined(WINDOWS_WITH_MSVC)
                 result = pkg_createWindowsDLL(mode, gencFilePath, o);
@@ -737,7 +737,7 @@ static int32_t pkg_executeOptions(UPKGOptions *o) {
                     return result;
                 }
             }
-#ifndef U_WINDOWS
+#if !U_PLATFORM_USES_ONLY_WIN32_API
             if(mode != MODE_STATIC) {
                 /* Certain platforms uses archive library. (e.g. AIX) */
                 if(o->verbose) {
@@ -748,7 +748,7 @@ static int32_t pkg_executeOptions(UPKGOptions *o) {
                     fprintf(stderr, "Error creating data archive library file.\n");
                    return result;
                 }
-#ifndef OS400
+#if U_PLATFORM != U_PF_OS400
                 /* Create symbolic links for the final library file. */
                 result = pkg_createSymLinks(targetDir);
                 if (result != 0) {
@@ -759,7 +759,7 @@ static int32_t pkg_executeOptions(UPKGOptions *o) {
             } /* !MODE_STATIC */
 #endif
 
-#if !defined(U_WINDOWS) || defined(USING_CYGWIN)
+#if !U_PLATFORM_USES_ONLY_WIN32_API
             /* Install the libraries if option was set. */
             if (o->install != NULL) {
                 if(o->verbose) {
@@ -856,7 +856,7 @@ static void createFileNames(UPKGOptions *o, const char mode, const char *version
         }
 
         if (version != NULL) {
-#if defined(U_CYGWIN)
+#if U_PLATFORM == U_PF_CYGWIN
             sprintf(libFileNames[LIB_FILE_CYGWIN], "cyg%s.%s",
                     libName,
                     pkgDataFlags[SO_EXT]);
@@ -868,7 +868,7 @@ static void createFileNames(UPKGOptions *o, const char mode, const char *version
             uprv_strcat(pkgDataFlags[SO_EXT], ".");
             uprv_strcat(pkgDataFlags[SO_EXT], pkgDataFlags[A_EXT]);
 
-#elif defined(OS400) || defined(_AIX)
+#elif U_PLATFORM == U_PF_OS400 || defined(_AIX)
             sprintf(libFileNames[LIB_FILE_VERSION_TMP], "%s.%s",
                     libFileNames[LIB_FILE],
                     pkgDataFlags[SOBJ_EXT]);
@@ -895,7 +895,7 @@ static void createFileNames(UPKGOptions *o, const char mode, const char *version
               fprintf(stdout, "# libFileName[LIB_FILE_VERSION] = %s\n", libFileNames[LIB_FILE_VERSION]);
             }
 
-#if defined(U_CYGWIN) || defined(U_MINGW)
+#if U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
             /* Cygwin and MinGW only deals with the version major number. */
             uprv_strcpy(libFileNames[LIB_FILE_VERSION_TMP], libFileNames[LIB_FILE_VERSION_MAJOR]);
 #endif
@@ -916,7 +916,7 @@ static int32_t pkg_createSymLinks(const char *targetDir, UBool specialHandling)
     char name1[SMALL_BUFFER_MAX_SIZE]; /* symlink file name */
     char name2[SMALL_BUFFER_MAX_SIZE]; /* file name to symlink */
 
-#if defined (U_MINGW)
+#if U_PLATFORM == U_PF_MINGW
     /* On MINGW, symbolic links don't need to be created. */
     return result;
 #endif
@@ -943,7 +943,7 @@ static int32_t pkg_createSymLinks(const char *targetDir, UBool specialHandling)
 #endif
 
     if (specialHandling) {
-#ifdef U_CYGWIN
+#if U_PLATFORM == U_PF_CYGWIN
         sprintf(name1, "%s", libFileNames[LIB_FILE_CYGWIN]);
         sprintf(name2, "%s", libFileNames[LIB_FILE_CYGWIN_VERSION]);
 #else
@@ -999,7 +999,7 @@ static int32_t pkg_installLibrary(const char *installDir, const char *targetDir)
         fprintf(stderr, "Error installing library. Failed command: %s\n", cmd);
         return result;
     }
-#elif defined(U_CYGWIN)
+#elif U_PLATFORM == U_PF_CYGWIN
     sprintf(cmd, "cd %s && %s %s %s",
             targetDir,
             pkgDataFlags[INSTALL_CMD],
@@ -1218,7 +1218,7 @@ static int32_t pkg_generateLibraryFile(const char *targetDir, const char mode, c
                      uprv_strlen(objectFile) + uprv_strlen(pkgDataFlags[LD_SONAME]) +
                      uprv_strlen(pkgDataFlags[LD_SONAME][0] == 0 ? "" : libFileNames[LIB_FILE_VERSION_MAJOR]) +
                      uprv_strlen(pkgDataFlags[RPATH_FLAGS]) + uprv_strlen(pkgDataFlags[BIR_FLAGS]) + BUFFER_PADDING_SIZE;
-#ifdef U_CYGWIN
+#if U_PLATFORM == U_PF_CYGWIN
             length += uprv_strlen(targetDir) + uprv_strlen(libFileNames[LIB_FILE_CYGWIN_VERSION]);
 #endif
             if ((cmd = (char *)uprv_malloc(sizeof(char) * length)) == NULL) {
@@ -1227,14 +1227,14 @@ static int32_t pkg_generateLibraryFile(const char *targetDir, const char mode, c
             }
             freeCmd = TRUE;
         }
-#if defined(U_CYGWIN)
+#if U_PLATFORM == U_PF_CYGWIN
         sprintf(cmd, "%s%s%s %s -o %s%s %s %s%s %s %s",
                 pkgDataFlags[GENLIB],
                 targetDir,
                 libFileNames[LIB_FILE_VERSION_TMP],
                 pkgDataFlags[LDICUDTFLAGS],
                 targetDir, libFileNames[LIB_FILE_CYGWIN_VERSION],
-#elif defined(U_AIX)
+#elif U_PLATFORM == U_PF_AIX
         sprintf(cmd, "%s %s%s;%s %s -o %s%s %s %s%s %s %s",
                 RM_CMD,
                 targetDir,
@@ -1605,7 +1605,7 @@ static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, U
 #endif
 
 static UPKGOptions *pkg_checkFlag(UPKGOptions *o) {
-#ifdef U_AIX
+#if U_PLATFORM == U_PF_AIX
     /* AIX needs a map file. */
     char *flag = NULL;
     int32_t length = 0;
@@ -1703,7 +1703,7 @@ static UPKGOptions *pkg_checkFlag(UPKGOptions *o) {
             T_FileStream_close(f);
         }
     }
-#elif defined(U_CYGWIN)
+#elif U_PLATFORM == U_PF_CYGWIN
     /* Cygwin needs to change flag options. */
     char *flag = NULL;
     int32_t length = 0;
@@ -1721,8 +1721,8 @@ static UPKGOptions *pkg_checkFlag(UPKGOptions *o) {
     }
 
     uprv_memset(flag + position, 0, length - position);
-#elif defined(OS400)
-    /* OS400 needs to fix the ld options (swap single quote with double quote) */
+#elif U_PLATFORM == U_PF_OS400
+    /* OS/400 needs to fix the ld options (swap single quote with double quote) */
     char *flag = NULL;
     int32_t length = 0;
 
index 2f47239d17ac4de0345ae7e2fb6818fee891a619..4fa86559465b10cf81233951405e5b1ed9afa9fd 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
 *
-*   Copyright (C) 2000-2009, International Business Machines
+*   Copyright (C) 2000-2011, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ***************************************************************************
@@ -132,7 +132,7 @@ char * convertToNativePathSeparators(char *path);
 
 /* set up common defines for library naming */
 
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
 # ifndef UDATA_SO_SUFFIX
 #  define UDATA_SO_SUFFIX ".dll"
 # endif
@@ -141,7 +141,7 @@ char * convertToNativePathSeparators(char *path);
 # define OBJ_SUFFIX ".obj"
 # define UDATA_LIB_SUFFIX ".lib"
 
-#elif defined(U_CYGWIN)
+#elif U_PLATFORM == U_PF_CYGWIN
 # define LIB_PREFIX "cyg"
 # define LIB_STATIC_PREFIX "lib"
 # define OBJ_SUFFIX ".o"
index 02ab0e8ea8da7ec1a752f645bc71390ffeadf8f7..abada61250aa990f58cce983f3ce391ec6b1ed6a 100644 (file)
@@ -43,9 +43,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)
 DEFS += -DU_TOOLUTIL_IMPLEMENTATION
 LDFLAGS += $(LDFLAGSICUTOOLUTIL)
index bf646916f61aaa9093bd944ffe5995ca270a6663..7309747c705bd13765a3c5b71e7a8bbd48114cab 100644 (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.
 *
 ******************************************************************************
@@ -43,7 +43,7 @@ U_CAPI FileStream* U_EXPORT2
 T_FileStream_wopen(const wchar_t* filename, const wchar_t* mode)
 {
    // TBD: _wfopen is believed to be MS-specific? 
-#if defined(U_WINDOWS)
+#if U_PLATFORM_USES_ONLY_WIN32_API
     FILE* result = _wfopen(filename, mode);
     return (FileStream*)result;
 #else
index 931a4418ecf514af924bb99b34d95ee23c314cd4..c065d57f37f71cc15b68418761d2749e4ad7ece5 100644 (file)
@@ -1,11 +1,11 @@
 /******************************************************************************
- *   Copyright (C) 2009-2010, International Business Machines
+ *   Copyright (C) 2009-2011, International Business Machines
  *   Corporation and others.  All Rights Reserved.
  *******************************************************************************
  */
 #include "unicode/utypes.h"
 
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
 #   define VC_EXTRALEAN
 #   define WIN32_LEAN_AND_MEAN
 #   define NOUSER
@@ -19,7 +19,7 @@
 #   endif
 #endif
 
-#ifdef U_LINUX
+#if U_PLATFORM_IS_LINUX_BASED
 #   define U_ELF
 #endif
 
@@ -51,7 +51,7 @@
 #define HEX_0X 0 /*  0x1234 */
 #define HEX_0H 1 /*  01234h */
 
-#if defined(U_WINDOWS) || defined(U_ELF)
+#if U_PLATFORM_HAS_WIN32_API || defined(U_ELF)
 #define CAN_GENERATE_OBJECTS
 #endif
 
@@ -65,7 +65,7 @@ write8(FileStream *out, uint8_t byte, uint32_t column);
 static uint32_t
 write32(FileStream *out, uint32_t byte, uint32_t column);
 
-#ifdef OS400
+#if U_PLATFORM == U_PF_OS400
 static uint32_t
 write8str(FileStream *out, uint8_t byte, uint32_t column);
 #endif
@@ -359,7 +359,7 @@ writeCCode(const char *filename, const char *destdir, const char *optName, const
         }
     }
 
-#ifdef OS400
+#if U_PLATFORM == U_PF_OS400
     /*
     TODO: Fix this once the compiler implements this feature. Keep in sync with udatamem.c
 
@@ -531,7 +531,7 @@ write8(FileStream *out, uint8_t byte, uint32_t column) {
     return column;
 }
 
-#ifdef OS400
+#if U_PLATFORM == U_PF_OS400
 static uint32_t
 write8str(FileStream *out, uint8_t byte, uint32_t column) {
     char s[8];
@@ -628,7 +628,7 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char
 #ifdef U_ELF
         Elf32_Ehdr  header32;
         /* Elf32_Ehdr and ELF64_Ehdr are identical for the necessary fields. */
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
         IMAGE_FILE_HEADER header;
 #endif
     } buffer;
@@ -639,7 +639,7 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char
 
 #ifdef U_ELF
 
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
     const IMAGE_FILE_HEADER *pHeader;
 #else
 #   error "Unknown platform for CAN_GENERATE_OBJECTS."
@@ -654,7 +654,7 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char
         *pCPU=EM_386;
         *pBits=32;
         *pIsBigEndian=(UBool)(U_IS_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB);
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
 /* _M_IA64 should be defined in windows.h */
 #   if defined(_M_IA64)
         *pCPU=IMAGE_FILE_MACHINE_IA64;
@@ -715,7 +715,7 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char
     /* TODO: Support byte swapping */
 
     *pCPU=buffer.header32.e_machine;
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
     if(length<sizeof(IMAGE_FILE_HEADER)) {
         fprintf(stderr, "genccode: match-arch file %s is too short\n", filename);
         exit(U_UNSUPPORTED_ERROR);
@@ -975,7 +975,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
 
     newSuffix=".o";
 
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
     struct {
         IMAGE_FILE_HEADER fileHeader;
         IMAGE_SECTION_HEADER sections[2];
@@ -1002,7 +1002,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
     /* deal with options, files and the entry point name */
     getArchitecture(&cpu, &bits, &makeBigEndian, optMatchArch);
     printf("genccode: --match-arch cpu=%hu bits=%hu big-endian=%hu\n", cpu, bits, makeBigEndian);
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
     if(cpu==IMAGE_FILE_MACHINE_I386) {
         entryOffset=1;
     }
@@ -1087,7 +1087,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
     if(paddingSize!=0) {
         T_FileStream_write(out, padding, paddingSize);
     }
-#elif defined(U_WINDOWS)
+#elif U_PLATFORM_HAS_WIN32_API
     /* populate the .obj headers */
     uprv_memset(&objHeader, 0, sizeof(objHeader));
     uprv_memset(&symbols, 0, sizeof(symbols));
@@ -1148,7 +1148,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
         T_FileStream_write(out, buffer, (int32_t)length);
     }
 
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
     /* write the symbol table */
     T_FileStream_write(out, symbols, IMAGE_SIZEOF_SYMBOL);
     T_FileStream_write(out, &symbolNames, symbolNames.sizeofLongNames);
index 583585f7cb2cbc08069dddec434a07cd4bf444de..711d7e679d5034de847a6bcea8ca7d15dc43f745 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-* Copyright (c) 2009, International Business Machines
+* Copyright (c) 2009-2011, International Business Machines
 * Corporation and others.  All Rights Reserved.
 **********************************************************************
 */
@@ -27,7 +27,7 @@
  *  -AIX/VACPP
  *  -Solaris/GCC
  */
-#if (defined(U_AIX) && !defined(__GNUC__)) || (defined(U_SOLARIS) && defined(__GNUC__))
+#if (U_PLATFORM == U_PF_AIX && !defined(__GNUC__)) || (U_PLATFORM == U_PF_SOLARIS && defined(__GNUC__))
 #   if _XOPEN_SOURCE_EXTENDED && !defined(U_HAVE_STD_STRING)
 #   define U_HAVE_STD_STRING 0
 #   endif
index 33f3346f78abbdb1979c285da94a7f19fc159f5c..41d552d14e72b57a12c8a02a2b7a77e75462d17f 100644 (file)
@@ -22,7 +22,7 @@
 #include <sys/stat.h>
 #include "unicode/utypes.h"
 
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
 #   define VC_EXTRALEAN
 #   define WIN32_LEAN_AND_MEAN
 #   define NOUSER
@@ -37,7 +37,7 @@
 #endif
 
 /* In MinGW environment, io.h needs to be included for _mkdir() */
-#ifdef U_MINGW
+#if U_PLATFORM == U_PF_MINGW
 #include <io.h>
 #endif
 
@@ -86,7 +86,7 @@ U_CAPI int32_t U_EXPORT2 getCurrentYear() {
 
 U_CAPI const char * U_EXPORT2
 getLongPathname(const char *pathname) {
-#ifdef U_WINDOWS
+#if U_PLATFORM_HAS_WIN32_API
     /* anticipate problems with "short" pathnames */
     static WIN32_FIND_DATAA info;
     HANDLE file=FindFirstFileA(pathname, &info);
@@ -166,13 +166,13 @@ U_CAPI void U_EXPORT2
 uprv_mkdir(const char *pathname, UErrorCode *status) {
 
     int retVal = 0;
-#if defined(U_WINDOWS) || defined(U_MINGW)
+#if U_PLATFORM_USES_ONLY_WIN32_API
     retVal = _mkdir(pathname);
 #else
     retVal = mkdir(pathname, S_IRWXU | (S_IROTH | S_IXOTH) | (S_IROTH | S_IXOTH));
 #endif
     if (retVal && errno != EEXIST) {
-#if defined(U_CYGWIN) || defined(U_MINGW)
+#if U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
         /*if using Cygwin and the mkdir says it failed...check if the directory already exists..*/
         /* if it does...don't give the error, if it does not...give the error - Brian Rower - 6/25/08 */
         struct stat st;
index be32942cde409db03a2b39ec6334f6a5bbbb0130..980d2dbc548b949434d05b326f485a3fc54a3cb6 100644 (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.
 *
 *******************************************************************************
@@ -21,7 +21,7 @@
 
 #include "unicode/utypes.h"
 
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
 
 #include "unicode/errorcode.h"
 
index 55e30f681b290a519f68b64e872ea001b5e9c6eb..43db65f281fc1934cb888363660cb33175534ac2 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2000, International Business Machines
+*   Copyright (C) 2000-2011, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -22,7 +22,7 @@
 #include "unicode/utypes.h"
 
 /* This should usually be called before calling u_parseArgs */
-/*#if defined(OS390) && (U_CHARSET_FAMILY == U_ASCII_FAMILY)*/
+/*#if U_PLATFORM == U_PF_OS390 && (U_CHARSET_FAMILY == U_ASCII_FAMILY)*/
     /* translate args from EBCDIC to ASCII */
 /*#   define U_MAIN_INIT_ARGS(argc, argv) __argvtoascii_a(argc, argv)*/
 /*#elif defined(XP_MAC_CONSOLE)*/