diff --git a/icu4c/source/common/platform.h.in b/icu4c/source/common/platform.h.in index 6fca0fa6887..7035deb4846 100644 --- a/icu4c/source/common/platform.h.in +++ b/icu4c/source/common/platform.h.in @@ -49,22 +49,6 @@ #include #endif -#if defined(__OS2__) - #ifdef OS2 - #undef OS2 - #endif - #define OS2 1 -#endif - - - -/* XP_CPLUSPLUS is a cross-platform symbol which should be defined when - using C++. It should not be defined when compiling under C. */ -#undef XP_CPLUSPLUS -#ifdef __cplusplus -#define XP_CPLUSPLUS -#endif - /*===========================================================================*/ /* Generic data types */ /*===========================================================================*/ @@ -104,43 +88,10 @@ typedef unsigned long uint32_t; #include #define T_INT32_MAX (LONG_MAX) -/*===========================================================================*/ -/* Boolean data type */ -/*===========================================================================*/ - -#undef TRUE -#undef FALSE - -#if ! HAVE_BOOL_T -typedef int8_t bool_t; -#endif - -#define TRUE 1 -#define FALSE 0 - -/*===========================================================================*/ -/* Unicode string offset */ -/*===========================================================================*/ -typedef int32_t UTextOffset; - -/*===========================================================================*/ -/* Unicode character */ -/*===========================================================================*/ -/* Another common UChar definition is wchar_t. However, this is valid - * only if wchar_t is at least 16 bits and in Unicode encoding. */ -typedef uint16_t UChar; - /*===========================================================================*/ /* Symbol import-export control */ /*===========================================================================*/ -#ifdef _WIN32 -#define U_EXPORT __declspec(dllexport) -#define U_IMPORT __declspec(dllimport) -#elif defined(AS400) -#define U_EXPORT __declspec(dllexport) -#define U_IMPORT -#else #define U_EXPORT +#define U_EXPORT2 #define U_IMPORT -#endif diff --git a/icu4c/source/common/pos2.h b/icu4c/source/common/pos2.h index d9e83e0a27e..766bef87518 100644 --- a/icu4c/source/common/pos2.h +++ b/icu4c/source/common/pos2.h @@ -37,35 +37,6 @@ #define HAVE_UINT32_T 0 #define HAVE_BOOL_T 0 -/*===========================================================================*/ -/* Platform/Language determination */ -/*===========================================================================*/ - -#ifdef macintosh -#ifdef XP_MAC -#undef XP_MAC -#endif -#define XP_MAC 1 -#include -#endif - -//#if defined(__OS2__) || defined(OS//2) -#if defined(__OS2__) - #ifdef OS2 - #undef OS2 - #endif - #define OS2 1 -#endif - - - -/* XP_CPLUSPLUS is a cross-platform symbol which should be defined when - using C++. It should not be defined when compiling under C. */ -#undef XP_CPLUSPLUS -#ifdef __cplusplus -#define XP_CPLUSPLUS -#endif - /*===========================================================================*/ /* Generic data types */ /*===========================================================================*/ @@ -105,43 +76,10 @@ typedef unsigned long uint32_t; #include #define T_INT32_MAX (LONG_MAX) -/*===========================================================================*/ -/* Boolean data type */ -/*===========================================================================*/ - -#undef TRUE -#undef FALSE - -#if ! HAVE_BOOL_T -typedef int8_t bool_t; -#endif - -#define TRUE 1 -#define FALSE 0 - -/*===========================================================================*/ -/* Unicode string offset */ -/*===========================================================================*/ -typedef int32_t UTextOffset; - -/*===========================================================================*/ -/* Unicode character */ -/*===========================================================================*/ -/* Another common UChar definition is wchar_t. However, this is valid - * only if wchar_t is at least 16 bits and in Unicode encoding. */ -typedef uint16_t UChar; - /*===========================================================================*/ /* Symbol import-export control */ /*===========================================================================*/ -#ifdef _WIN32 -#define U_EXPORT __declspec(dllexport) -#define U_IMPORT __declspec(dllimport) -#elif defined(AS400) -#define U_EXPORT __declspec(dllexport) -#define U_IMPORT -#else #define U_EXPORT +#define U_EXPORT2 #define U_IMPORT -#endif diff --git a/icu4c/source/common/pwin32.h b/icu4c/source/common/pwin32.h index 7c74fafbdb9..1d6fea74ff4 100644 --- a/icu4c/source/common/pwin32.h +++ b/icu4c/source/common/pwin32.h @@ -37,25 +37,6 @@ #define HAVE_UINT32_T 0 #define HAVE_BOOL_T 0 -/*===========================================================================*/ -/* Platform/Language determination */ -/*===========================================================================*/ - -#ifdef macintosh -#ifdef XP_MAC -#undef XP_MAC -#endif -#define XP_MAC 1 -#include -#endif - -/* XP_CPLUSPLUS is a cross-platform symbol which should be defined when - using C++. It should not be defined when compiling under C. */ -#undef XP_CPLUSPLUS -#ifdef __cplusplus -#define XP_CPLUSPLUS -#endif - /*===========================================================================*/ /* Generic data types */ /*===========================================================================*/ @@ -95,43 +76,10 @@ typedef unsigned long uint32_t; #include #define T_INT32_MAX (LONG_MAX) -/*===========================================================================*/ -/* Boolean data type */ -/*===========================================================================*/ - -#undef TRUE -#undef FALSE - -#if ! HAVE_BOOL_T -typedef int8_t bool_t; -#endif - -#define TRUE 1 -#define FALSE 0 - -/*===========================================================================*/ -/* Unicode string offset */ -/*===========================================================================*/ -typedef int32_t UTextOffset; - -/*===========================================================================*/ -/* Unicode character */ -/*===========================================================================*/ -/* Another common UChar definition is wchar_t. However, this is valid - * only if wchar_t is at least 16 bits and in Unicode encoding. */ -typedef uint16_t UChar; - /*===========================================================================*/ /* Symbol import-export control */ /*===========================================================================*/ -#ifdef _WIN32 #define U_EXPORT __declspec(dllexport) +#define U_EXPORT2 #define U_IMPORT __declspec(dllimport) -#elif defined(AS400) -#define U_EXPORT __declspec(dllexport) -#define U_IMPORT -#else -#define U_EXPORT -#define U_IMPORT -#endif diff --git a/icu4c/source/common/utypes.h b/icu4c/source/common/utypes.h index 16c34ed9201..eee50053ac7 100644 --- a/icu4c/source/common/utypes.h +++ b/icu4c/source/common/utypes.h @@ -48,13 +48,50 @@ /*===========================================================================*/ #if defined(WIN32) || defined(_WIN32) -#include "pwin32.h" +# include "pwin32.h" #elif defined(__OS2__) -#include "pos2.h" +# include "pos2.h" +#elif defined(__OS400__) +# include "pos400.h" #else -#include "platform.h" +# include "platform.h" #endif +/* 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 + +/*===========================================================================*/ +/* Boolean data type */ +/*===========================================================================*/ + +#if ! HAVE_BOOL_T +typedef int8_t bool_t; +#endif + +#ifndef TRUE +# define TRUE 1 +#endif +#ifndef FALSE +# define FALSE 0 +#endif + +/*===========================================================================*/ +/* Unicode string offset */ +/*===========================================================================*/ +typedef int32_t UTextOffset; + +/*===========================================================================*/ +/* Unicode character */ +/*===========================================================================*/ +typedef uint16_t UChar; + /*===========================================================================*/ /* ICU version number */ /*===========================================================================*/ @@ -78,30 +115,15 @@ /*===========================================================================*/ /* For C wrappers, we use the symbol CAPI. */ /* This works properly if the includer is C or C++. */ -/* ADDED MVS SPECIFICS - JJD Including: FUNC_EXPORT */ -/* Since _Export MUST come after return type */ +/* Functions are declared CAPI return-type U_EXPORT2 function-name() ... */ /*===========================================================================*/ #ifdef XP_CPLUSPLUS -# define C_FUNC extern "C" -# ifdef OS390 -# define CAPI C_FUNC -# define U_EXPORT2 U_EXPORT -# else -# define CAPI C_FUNC U_EXPORT -# define U_EXPORT2 -# endif +# define C_FUNC extern "C" #else -#define C_FUNC -#if defined(OS390) -# define CAPI -# define U_EXPORT2 U_EXPORT -#else -# define CAPI U_EXPORT -# define U_EXPORT2 +# define C_FUNC #endif -#endif - +#define CAPI C_FUNC U_EXPORT /* Define NULL pointer value if it isn't already defined */