From: Markus Scherer Date: Wed, 27 Jul 2011 20:55:09 +0000 (+0000) Subject: ICU-8730 move some @internal, rarely-used platform macros to putilimp.h X-Git-Tag: milestone-59-0-1~4618 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca12d6d5bdad394b2e1c2d9b68c5364b0d282519;p=icu ICU-8730 move some @internal, rarely-used platform macros to putilimp.h X-SVN-Rev: 30432 --- diff --git a/icu4c/source/common/putilimp.h b/icu4c/source/common/putilimp.h index cee8026b230..a82d77297dd 100644 --- a/icu4c/source/common/putilimp.h +++ b/icu4c/source/common/putilimp.h @@ -19,6 +19,128 @@ #include "unicode/utypes.h" #include "unicode/putil.h" +/** + * \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 + +/*===========================================================================*/ +/** @{ 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 + +/** + * \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 + +/** @} */ + +/*===========================================================================*/ +/** @{ 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 + +/** @} */ + /*==========================================================================*/ /* Platform utilities */ /*==========================================================================*/ diff --git a/icu4c/source/common/umapfile.h b/icu4c/source/common/umapfile.h index 1f4b43c5d9e..1de9f412d7b 100644 --- a/icu4c/source/common/umapfile.h +++ b/icu4c/source/common/umapfile.h @@ -25,6 +25,7 @@ #include "unicode/putil.h" #include "unicode/udata.h" +#include "putilimp.h" U_CFUNC UBool uprv_mapFile(UDataMemory *pdm, const char *path); U_CFUNC void uprv_unmapFile(UDataMemory *pData); diff --git a/icu4c/source/common/umutex.h b/icu4c/source/common/umutex.h index 089afb775e5..78cfc890adf 100644 --- a/icu4c/source/common/umutex.h +++ b/icu4c/source/common/umutex.h @@ -20,6 +20,7 @@ #include "unicode/utypes.h" #include "unicode/uclean.h" +#include "putilimp.h" #if defined(_MSC_VER) && _MSC_VER >= 1500 # include diff --git a/icu4c/source/common/unicode/platform.h b/icu4c/source/common/unicode/platform.h index 99e9da88ea2..d136ef59184 100644 --- a/icu4c/source/common/unicode/platform.h +++ b/icu4c/source/common/unicode/platform.h @@ -240,19 +240,6 @@ # 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. @@ -625,70 +612,6 @@ /** @} */ -/*===========================================================================*/ -/** @{ 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 */ /*===========================================================================*/ @@ -767,51 +690,6 @@ /** @} */ -/** - * \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 */ /*===========================================================================*/ diff --git a/icu4c/source/common/utrie2.h b/icu4c/source/common/utrie2.h index 439d0d3dfe4..1bac06ac657 100644 --- a/icu4c/source/common/utrie2.h +++ b/icu4c/source/common/utrie2.h @@ -18,6 +18,7 @@ #define __UTRIE2_H__ #include "unicode/utypes.h" +#include "putilimp.h" #include "udataswp.h" U_CDECL_BEGIN diff --git a/icu4c/source/tools/pkgdata/pkgtypes.c b/icu4c/source/tools/pkgdata/pkgtypes.c index 7b71054c572..2769e453821 100644 --- a/icu4c/source/tools/pkgdata/pkgtypes.c +++ b/icu4c/source/tools/pkgdata/pkgtypes.c @@ -1,6 +1,6 @@ /************************************************************************** * -* Copyright (C) 2000-2008, International Business Machines +* Copyright (C) 2000-2011, International Business Machines * Corporation and others. All Rights Reserved. * *************************************************************************** @@ -22,7 +22,7 @@ #include "cmemory.h" #include "cstring.h" #include "pkgtypes.h" - +#include "putilimp.h" const char *pkg_writeCharListWrap(FileStream *s, CharList *l, const char *delim, const char *brk, int32_t quote) { diff --git a/icu4c/source/tools/toolutil/filetools.cpp b/icu4c/source/tools/toolutil/filetools.cpp index 058a6f7ccb3..7f560f6cd37 100644 --- a/icu4c/source/tools/toolutil/filetools.cpp +++ b/icu4c/source/tools/toolutil/filetools.cpp @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (C) 2009, International Business Machines + * Copyright (C) 2009-2011, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* */ @@ -8,6 +8,7 @@ #include "filestrm.h" #include "cstring.h" #include "unicode/putil.h" +#include "putilimp.h" #include #include