simplify platform.h and cousins by moving common definitions into utypes.h

X-Commit-URL: https://ssl.icu-project.org/trac/changeset/26
This commit is contained in:
Markus Scherer 1999-10-09 01:08:45 +00:00
parent dc971344b2
commit b15e98ef58
4 changed files with 47 additions and 188 deletions

View file

@ -49,22 +49,6 @@
#include <string.h>
#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 <limits.h>
#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

View file

@ -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 <string.h>
#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 <limits.h>
#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

View file

@ -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 <string.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. */
#undef XP_CPLUSPLUS
#ifdef __cplusplus
#define XP_CPLUSPLUS
#endif
/*===========================================================================*/
/* Generic data types */
/*===========================================================================*/
@ -95,43 +76,10 @@ typedef unsigned long uint32_t;
#include <limits.h>
#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

View file

@ -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 */