From 07035f8756e26aec27866d789a6b1e8798f90fab Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Wed, 27 Jul 2011 21:26:00 +0000 Subject: [PATCH] ICU-8731 move some @internal definitions to putilimp.h X-SVN-Rev: 30433 --- icu4c/source/common/locid.cpp | 1 + icu4c/source/common/putilimp.h | 49 ++++++++++++++++++++++++++ icu4c/source/common/ucnv_bld.cpp | 1 + icu4c/source/common/ucnvbocu.cpp | 1 + icu4c/source/common/unicode/platform.h | 20 ----------- icu4c/source/common/unicode/putil.h | 29 --------------- icu4c/source/i18n/decContext.h | 3 +- 7 files changed, 54 insertions(+), 50 deletions(-) diff --git a/icu4c/source/common/locid.cpp b/icu4c/source/common/locid.cpp index 4085ddbfae..d340f406db 100644 --- a/icu4c/source/common/locid.cpp +++ b/icu4c/source/common/locid.cpp @@ -32,6 +32,7 @@ #include "unicode/locid.h" #include "unicode/uloc.h" +#include "putilimp.h" #include "umutex.h" #include "uassert.h" #include "cmemory.h" diff --git a/icu4c/source/common/putilimp.h b/icu4c/source/common/putilimp.h index a82d77297d..e4d64aa76a 100644 --- a/icu4c/source/common/putilimp.h +++ b/icu4c/source/common/putilimp.h @@ -19,6 +19,12 @@ #include "unicode/utypes.h" #include "unicode/putil.h" +/** Define this to 1 if your platform supports IEEE 754 floating point, + to 0 if it does not. */ +#ifndef IEEE_754 +# define IEEE_754 1 +#endif + /** * \def U_HAVE_MSVC_2003_OR_EARLIER * Flag for workaround of MSVC 2003 optimization bugs @@ -123,6 +129,26 @@ /** @} */ +/*===========================================================================*/ +/** @{ 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 + +/** @} */ + /*===========================================================================*/ /** @{ Programs used by ICU code */ /*===========================================================================*/ @@ -281,6 +307,29 @@ U_INTERNAL double U_EXPORT2 uprv_round(double x); /*U_INTERNAL int32_t U_EXPORT2 uprv_digitsAfterDecimal(double x);*/ #endif +#if !U_CHARSET_IS_UTF8 +/** + * Please use ucnv_getDefaultName() instead. + * Return the default codepage for this platform and locale. + * This function can call setlocale() on Unix platforms. Please read the + * platform documentation on setlocale() before calling this function. + * @return the default codepage for this platform + * @internal + */ +U_INTERNAL const char* U_EXPORT2 uprv_getDefaultCodepage(void); +#endif + +/** + * Please use uloc_getDefault() instead. + * Return the default locale ID string by querying ths system, or + * zero if one cannot be found. + * This function can call setlocale() on Unix platforms. Please read the + * platform documentation on setlocale() before calling this function. + * @return the default locale ID string + * @internal + */ +U_INTERNAL const char* U_EXPORT2 uprv_getDefaultLocaleID(void); + /** * Time zone utilities * diff --git a/icu4c/source/common/ucnv_bld.cpp b/icu4c/source/common/ucnv_bld.cpp index b3f8951c1d..5d3266aab9 100644 --- a/icu4c/source/common/ucnv_bld.cpp +++ b/icu4c/source/common/ucnv_bld.cpp @@ -27,6 +27,7 @@ #include "unicode/udata.h" #include "unicode/ucnv.h" #include "unicode/uloc.h" +#include "putilimp.h" #include "utracimp.h" #include "ucnv_io.h" #include "ucnv_bld.h" diff --git a/icu4c/source/common/ucnvbocu.cpp b/icu4c/source/common/ucnvbocu.cpp index 9d6fe9a5bf..9898f50c39 100644 --- a/icu4c/source/common/ucnvbocu.cpp +++ b/icu4c/source/common/ucnvbocu.cpp @@ -24,6 +24,7 @@ #include "unicode/ucnv.h" #include "unicode/ucnv_cb.h" #include "unicode/utf16.h" +#include "putilimp.h" #include "ucnv_bld.h" #include "ucnv_cnv.h" diff --git a/icu4c/source/common/unicode/platform.h b/icu4c/source/common/unicode/platform.h index d136ef5918..2d2c6dace1 100644 --- a/icu4c/source/common/unicode/platform.h +++ b/icu4c/source/common/unicode/platform.h @@ -670,26 +670,6 @@ /* @} */ -/*===========================================================================*/ -/** @{ 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 - -/** @} */ - /*===========================================================================*/ /* Custom icu entry point renaming */ /*===========================================================================*/ diff --git a/icu4c/source/common/unicode/putil.h b/icu4c/source/common/unicode/putil.h index 5bd5983f0a..6fc7e9cd5a 100644 --- a/icu4c/source/common/unicode/putil.h +++ b/icu4c/source/common/unicode/putil.h @@ -30,12 +30,6 @@ * \brief C API: Platform Utilities */ -/** Define this to 1 if your platform supports IEEE 754 floating point, - to 0 if it does not. */ -#ifndef IEEE_754 -# define IEEE_754 1 -#endif - /*==========================================================================*/ /* Platform utilities */ /*==========================================================================*/ @@ -93,29 +87,6 @@ U_STABLE const char* U_EXPORT2 u_getDataDirectory(void); */ U_STABLE void U_EXPORT2 u_setDataDirectory(const char *directory); -#if !U_CHARSET_IS_UTF8 -/** - * Please use ucnv_getDefaultName() instead. - * Return the default codepage for this platform and locale. - * This function can call setlocale() on Unix platforms. Please read the - * platform documentation on setlocale() before calling this function. - * @return the default codepage for this platform - * @internal - */ -U_INTERNAL const char* U_EXPORT2 uprv_getDefaultCodepage(void); -#endif - -/** - * Please use uloc_getDefault() instead. - * Return the default locale ID string by querying ths system, or - * zero if one cannot be found. - * This function can call setlocale() on Unix platforms. Please read the - * platform documentation on setlocale() before calling this function. - * @return the default locale ID string - * @internal - */ -U_INTERNAL const char* U_EXPORT2 uprv_getDefaultLocaleID(void); - /** * @{ * Filesystem file and path separator characters. diff --git a/icu4c/source/i18n/decContext.h b/icu4c/source/i18n/decContext.h index c25e495e76..78d90fd6b5 100644 --- a/icu4c/source/i18n/decContext.h +++ b/icu4c/source/i18n/decContext.h @@ -1,7 +1,7 @@ /* ------------------------------------------------------------------ */ /* Decimal Context module header */ /* ------------------------------------------------------------------ */ -/* Copyright (c) IBM Corporation, 2000-2010. All rights reserved. */ +/* Copyright (c) IBM Corporation, 2000-2011. All rights reserved. */ /* */ /* This software is made available under the terms of the */ /* ICU License -- ICU 1.8.1 and later. */ @@ -28,6 +28,7 @@ * Remove a few compiler warnings. */ #include "unicode/utypes.h" +#include "putilimp.h" /* */ /* Context variables must always have valid values: */