From a91586a1d3c3f115f7067d33ef1804e2c4046611 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Sun, 18 Jul 2004 09:00:39 +0000 Subject: [PATCH] ICU-3614 Sync up platform.h and pwin32.h X-SVN-Rev: 16041 --- icu4c/source/common/unicode/platform.h.in | 11 +- icu4c/source/common/unicode/pwin32.h | 145 +++++++++++++++------- icu4c/source/icudefs.mk.in | 6 +- 3 files changed, 105 insertions(+), 57 deletions(-) diff --git a/icu4c/source/common/unicode/platform.h.in b/icu4c/source/common/unicode/platform.h.in index c8604d6e9ee..e1dcfdc1488 100644 --- a/icu4c/source/common/unicode/platform.h.in +++ b/icu4c/source/common/unicode/platform.h.in @@ -1,10 +1,10 @@ /* -******************************************************************************* +****************************************************************************** * * Copyright (C) 1997-2004, International Business Machines * Corporation and others. All Rights Reserved. * -******************************************************************************* +****************************************************************************** * * FILE NAME : platform.h * @@ -13,7 +13,7 @@ * 03/02/99 stephen Added AS400 support. * 03/30/99 stephen Added Linux support. * 04/13/99 stephen Reworked for autoconf. -******************************************************************************* +****************************************************************************** */ /* Define the platform we're on. */ @@ -107,11 +107,6 @@ typedef unsigned char uint8_t; #else /* U_HAVE_INTTYPES_H */ -#if STDC_HEADERS -#include -#include -#endif /* STDC_HEADERS */ - #if ! U_HAVE_INT8_T typedef signed char int8_t; #endif diff --git a/icu4c/source/common/unicode/pwin32.h b/icu4c/source/common/unicode/pwin32.h index 1d191b25438..139e747cd67 100644 --- a/icu4c/source/common/unicode/pwin32.h +++ b/icu4c/source/common/unicode/pwin32.h @@ -22,7 +22,9 @@ #endif /* Define whether inttypes.h is available */ +#ifndef U_HAVE_INTTYPES_H #define U_HAVE_INTTYPES_H 0 +#endif /* * Define what support for C++ streams is available. @@ -42,55 +44,43 @@ #define U_IOSTREAM_SOURCE 199711 #endif -#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 - /* Determines whether specific types are available */ +#ifndef U_HAVE_INT8_T #define U_HAVE_INT8_T 0 +#endif + +#ifndef U_HAVE_UINT8_T #define U_HAVE_UINT8_T 0 +#endif + +#ifndef U_HAVE_INT16_T #define U_HAVE_INT16_T 0 +#endif + +#ifndef U_HAVE_UINT16_T #define U_HAVE_UINT16_T 0 +#endif + +#ifndef U_HAVE_INT32_T #define U_HAVE_INT32_T 0 +#endif + +#ifndef U_HAVE_UINT32_T #define U_HAVE_UINT32_T 0 +#endif + +#ifndef U_HAVE_INT64_T #define U_HAVE_INT64_T 0 +#endif + +#ifndef U_HAVE_UINT64_T #define U_HAVE_UINT64_T 0 +#endif /* Define 64 bit limits */ #define INT64_C(x) x #define UINT64_C(x) x -/* Define whether namespace is supported */ -#define U_HAVE_NAMESPACE 1 - -/* Determines the endianness of the platform */ -#define U_IS_BIG_ENDIAN 0 - -/* 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 enable tracing. */ -#ifndef U_ENABLE_TRACING -#define U_ENABLE_TRACING 1 -#endif /*===========================================================================*/ /* Generic data types */ @@ -100,7 +90,7 @@ need to edit the typedefs below. */ #if U_HAVE_INTTYPES_H #include -#else +#else /* U_HAVE_INTTYPES_H */ #if ! U_HAVE_INT8_T typedef signed char int8_t; @@ -127,28 +117,87 @@ typedef unsigned int uint32_t; #endif #if ! U_HAVE_INT64_T - /* Could use _MSC_VER to detect Microsoft compiler. */ +/* _MSC_VER is used to detect the Microsoft compiler. */ +#ifdef _MSC_VER typedef signed __int64 int64_t; +#else + typedef signed long long int64_t; +#endif #endif #if ! U_HAVE_UINT64_T - /* Could use _MSC_VER to detect Microsoft compiler. */ +/* _MSC_VER is used to detect the Microsoft compiler. */ +#ifdef _MSC_VER typedef unsigned __int64 uint64_t; +#else + typedef unsigned long long uint64_t; +#endif #endif - #endif /*===========================================================================*/ -/* Character data types */ +/* Compiler and environment features */ /*===========================================================================*/ +/* Define whether namespace is supported */ +#ifndef U_HAVE_NAMESPACE +#define U_HAVE_NAMESPACE 1 +#endif + +/* 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 1 +#endif + +/* Determine whether to enable tracing. */ +#ifndef U_ENABLE_TRACING +#define U_ENABLE_TRACING 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 -/*===========================================================================*/ -/* Do we have wcscpy and other similar functions */ -/*===========================================================================*/ - -#define U_HAVE_WCSCPY 1 +#define U_HAVE_WCSCPY 1 /*===========================================================================*/ /* Information about POSIX support */ @@ -161,7 +210,8 @@ typedef unsigned int uint32_t; #endif #define U_TZNAME _tzname -#define U_HAVE_MMAP 0 +#define U_HAVE_MMAP 0 +#define U_HAVE_POPEN 0 /*===========================================================================*/ /* Symbol import-export control */ @@ -179,7 +229,9 @@ typedef unsigned int uint32_t; /* Code alignment and C function inlining */ /*===========================================================================*/ +#ifndef U_INLINE #define U_INLINE __inline +#endif #if defined(_MSC_VER) && defined(_M_IX86) #define U_ALIGN_CODE(val) __asm align val @@ -193,4 +245,3 @@ typedef unsigned int uint32_t; /*===========================================================================*/ #define U_MAKE "nmake" - diff --git a/icu4c/source/icudefs.mk.in b/icu4c/source/icudefs.mk.in index 6a454f24671..f96974ba233 100644 --- a/icu4c/source/icudefs.mk.in +++ b/icu4c/source/icudefs.mk.in @@ -104,8 +104,10 @@ COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@ # Various flags for the tools -# DEFS is for common macro definitions -DEFS = @DEFS@ +# DEFS is for common macro definitions. +# configure prevents user defined DEFS, and configure's DEFS is not needed +# So we ignore the DEFS that comes from configure +DEFS = # CFLAGS is for C only flags CFLAGS = @CFLAGS@ # CXXFLAGS is for C++ only flags