1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/common/unicode/uconfig.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,412 @@ 1.4 +/* 1.5 +********************************************************************** 1.6 +* Copyright (C) 2002-2013, International Business Machines 1.7 +* Corporation and others. All Rights Reserved. 1.8 +********************************************************************** 1.9 +* file name: uconfig.h 1.10 +* encoding: US-ASCII 1.11 +* tab size: 8 (not used) 1.12 +* indentation:4 1.13 +* 1.14 +* created on: 2002sep19 1.15 +* created by: Markus W. Scherer 1.16 +*/ 1.17 + 1.18 +#ifndef __UCONFIG_H__ 1.19 +#define __UCONFIG_H__ 1.20 + 1.21 + 1.22 +/*! 1.23 + * \file 1.24 + * \brief User-configurable settings 1.25 + * 1.26 + * Miscellaneous switches: 1.27 + * 1.28 + * A number of macros affect a variety of minor aspects of ICU. 1.29 + * Most of them used to be defined elsewhere (e.g., in utypes.h or platform.h) 1.30 + * and moved here to make them easier to find. 1.31 + * 1.32 + * Switches for excluding parts of ICU library code modules: 1.33 + * 1.34 + * Changing these macros allows building partial, smaller libraries for special purposes. 1.35 + * By default, all modules are built. 1.36 + * The switches are fairly coarse, controlling large modules. 1.37 + * Basic services cannot be turned off. 1.38 + * 1.39 + * Building with any of these options does not guarantee that the 1.40 + * ICU build process will completely work. It is recommended that 1.41 + * the ICU libraries and data be built using the normal build. 1.42 + * At that time you should remove the data used by those services. 1.43 + * After building the ICU data library, you should rebuild the ICU 1.44 + * libraries with these switches customized to your needs. 1.45 + * 1.46 + * @stable ICU 2.4 1.47 + */ 1.48 + 1.49 +/** 1.50 + * If this switch is defined, ICU will attempt to load a header file named "uconfig_local.h" 1.51 + * prior to determining default settings for uconfig variables. 1.52 + * 1.53 + * @internal ICU 4.0 1.54 + */ 1.55 +#if defined(UCONFIG_USE_LOCAL) 1.56 +#include "uconfig_local.h" 1.57 +#endif 1.58 + 1.59 +/** 1.60 + * \def U_DEBUG 1.61 + * Determines whether to include debugging code. 1.62 + * Automatically set on Windows, but most compilers do not have 1.63 + * related predefined macros. 1.64 + * @internal 1.65 + */ 1.66 +#ifdef U_DEBUG 1.67 + /* Use the predefined value. */ 1.68 +#elif defined(_DEBUG) 1.69 + /* 1.70 + * _DEBUG is defined by Visual Studio debug compilation. 1.71 + * Do *not* test for its NDEBUG macro: It is an orthogonal macro 1.72 + * which disables assert(). 1.73 + */ 1.74 +# define U_DEBUG 1 1.75 +# else 1.76 +# define U_DEBUG 0 1.77 +#endif 1.78 + 1.79 +/** 1.80 + * Determines wheter to enable auto cleanup of libraries. 1.81 + * @internal 1.82 + */ 1.83 +#ifndef UCLN_NO_AUTO_CLEANUP 1.84 +#define UCLN_NO_AUTO_CLEANUP 1 1.85 +#endif 1.86 + 1.87 +/** 1.88 + * \def U_DISABLE_RENAMING 1.89 + * Determines whether to disable renaming or not. 1.90 + * @internal 1.91 + */ 1.92 +#ifndef U_DISABLE_RENAMING 1.93 +#define U_DISABLE_RENAMING 0 1.94 +#endif 1.95 + 1.96 +/** 1.97 + * \def U_NO_DEFAULT_INCLUDE_UTF_HEADERS 1.98 + * Determines whether utypes.h includes utf.h, utf8.h, utf16.h and utf_old.h. 1.99 + * utypes.h includes those headers if this macro is defined to 0. 1.100 + * Otherwise, each those headers must be included explicitly when using one of their macros. 1.101 + * Defaults to 0 for backward compatibility, except inside ICU. 1.102 + * @stable ICU 49 1.103 + */ 1.104 +#ifdef U_NO_DEFAULT_INCLUDE_UTF_HEADERS 1.105 + /* Use the predefined value. */ 1.106 +#elif defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || \ 1.107 + defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || \ 1.108 + defined(U_TOOLUTIL_IMPLEMENTATION) 1.109 +# define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 1 1.110 +#else 1.111 +# define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 0 1.112 +#endif 1.113 + 1.114 +/** 1.115 + * \def U_OVERRIDE_CXX_ALLOCATION 1.116 + * Determines whether to override new and delete. 1.117 + * ICU is normally built such that all of its C++ classes, via their UMemory base, 1.118 + * override operators new and delete to use its internal, customizable, 1.119 + * non-exception-throwing memory allocation functions. (Default value 1 for this macro.) 1.120 + * 1.121 + * This is especially important when the application and its libraries use multiple heaps. 1.122 + * For example, on Windows, this allows the ICU DLL to be used by 1.123 + * applications that statically link the C Runtime library. 1.124 + * 1.125 + * @stable ICU 2.2 1.126 + */ 1.127 +#ifndef U_OVERRIDE_CXX_ALLOCATION 1.128 +#define U_OVERRIDE_CXX_ALLOCATION 1 1.129 +#endif 1.130 + 1.131 +/** 1.132 + * \def U_ENABLE_TRACING 1.133 + * Determines whether to enable tracing. 1.134 + * @internal 1.135 + */ 1.136 +#ifndef U_ENABLE_TRACING 1.137 +#define U_ENABLE_TRACING 0 1.138 +#endif 1.139 + 1.140 +/** 1.141 + * \def U_ENABLE_DYLOAD 1.142 + * Whether to enable Dynamic loading in ICU. 1.143 + * @internal 1.144 + */ 1.145 +#ifndef U_ENABLE_DYLOAD 1.146 +#define U_ENABLE_DYLOAD 1 1.147 +#endif 1.148 + 1.149 +/** 1.150 + * \def U_CHECK_DYLOAD 1.151 + * Whether to test Dynamic loading as an OS capability. 1.152 + * @internal 1.153 + */ 1.154 +#ifndef U_CHECK_DYLOAD 1.155 +#define U_CHECK_DYLOAD 1 1.156 +#endif 1.157 + 1.158 + 1.159 +/** 1.160 + * \def U_DEFAULT_SHOW_DRAFT 1.161 + * Do we allow ICU users to use the draft APIs by default? 1.162 + * @internal 1.163 + */ 1.164 +#ifndef U_DEFAULT_SHOW_DRAFT 1.165 +#define U_DEFAULT_SHOW_DRAFT 1 1.166 +#endif 1.167 + 1.168 +/*===========================================================================*/ 1.169 +/* Custom icu entry point renaming */ 1.170 +/*===========================================================================*/ 1.171 + 1.172 +/** 1.173 + * \def U_HAVE_LIB_SUFFIX 1.174 + * 1 if a custom library suffix is set. 1.175 + * @internal 1.176 + */ 1.177 +#ifdef U_HAVE_LIB_SUFFIX 1.178 + /* Use the predefined value. */ 1.179 +#elif defined(U_LIB_SUFFIX_C_NAME) 1.180 +# define U_HAVE_LIB_SUFFIX 1 1.181 +#endif 1.182 + 1.183 +/** 1.184 + * \def U_LIB_SUFFIX_C_NAME_STRING 1.185 + * Defines the library suffix as a string with C syntax. 1.186 + * @internal 1.187 + */ 1.188 +#ifdef U_LIB_SUFFIX_C_NAME_STRING 1.189 + /* Use the predefined value. */ 1.190 +#elif defined(U_LIB_SUFFIX_C_NAME) 1.191 +# define U_LIB_SUFFIX_C_NAME_STRING #U_LIB_SUFFIX_C_NAME 1.192 +#else 1.193 +# define U_LIB_SUFFIX_C_NAME_STRING "" 1.194 +#endif 1.195 + 1.196 +/* common/i18n library switches --------------------------------------------- */ 1.197 + 1.198 +/** 1.199 + * \def UCONFIG_ONLY_COLLATION 1.200 + * This switch turns off modules that are not needed for collation. 1.201 + * 1.202 + * It does not turn off legacy conversion because that is necessary 1.203 + * for ICU to work on EBCDIC platforms (for the default converter). 1.204 + * If you want "only collation" and do not build for EBCDIC, 1.205 + * then you can define UCONFIG_NO_LEGACY_CONVERSION 1 as well. 1.206 + * 1.207 + * @stable ICU 2.4 1.208 + */ 1.209 +#ifndef UCONFIG_ONLY_COLLATION 1.210 +# define UCONFIG_ONLY_COLLATION 0 1.211 +#endif 1.212 + 1.213 +#if UCONFIG_ONLY_COLLATION 1.214 + /* common library */ 1.215 +# define UCONFIG_NO_BREAK_ITERATION 1 1.216 +# define UCONFIG_NO_IDNA 1 1.217 + 1.218 + /* i18n library */ 1.219 +# if UCONFIG_NO_COLLATION 1.220 +# error Contradictory collation switches in uconfig.h. 1.221 +# endif 1.222 +# define UCONFIG_NO_FORMATTING 1 1.223 +# define UCONFIG_NO_TRANSLITERATION 1 1.224 +# define UCONFIG_NO_REGULAR_EXPRESSIONS 1 1.225 +#endif 1.226 + 1.227 +/* common library switches -------------------------------------------------- */ 1.228 + 1.229 +/** 1.230 + * \def UCONFIG_NO_FILE_IO 1.231 + * This switch turns off all file access in the common library 1.232 + * where file access is only used for data loading. 1.233 + * ICU data must then be provided in the form of a data DLL (or with an 1.234 + * equivalent way to link to the data residing in an executable, 1.235 + * as in building a combined library with both the common library's code and 1.236 + * the data), or via udata_setCommonData(). 1.237 + * Application data must be provided via udata_setAppData() or by using 1.238 + * "open" functions that take pointers to data, for example ucol_openBinary(). 1.239 + * 1.240 + * File access is not used at all in the i18n library. 1.241 + * 1.242 + * File access cannot be turned off for the icuio library or for the ICU 1.243 + * test suites and ICU tools. 1.244 + * 1.245 + * @stable ICU 3.6 1.246 + */ 1.247 +#ifndef UCONFIG_NO_FILE_IO 1.248 +# define UCONFIG_NO_FILE_IO 0 1.249 +#endif 1.250 + 1.251 +/** 1.252 + * \def UCONFIG_NO_CONVERSION 1.253 + * ICU will not completely build with this switch turned on. 1.254 + * This switch turns off all converters. 1.255 + * 1.256 + * You may want to use this together with U_CHARSET_IS_UTF8 defined to 1 1.257 + * in utypes.h if char* strings in your environment are always in UTF-8. 1.258 + * 1.259 + * @stable ICU 3.2 1.260 + * @see U_CHARSET_IS_UTF8 1.261 + */ 1.262 +#ifndef UCONFIG_NO_CONVERSION 1.263 +# define UCONFIG_NO_CONVERSION 0 1.264 +#endif 1.265 + 1.266 +#if UCONFIG_NO_CONVERSION 1.267 +# define UCONFIG_NO_LEGACY_CONVERSION 1 1.268 +#endif 1.269 + 1.270 +/** 1.271 + * \def UCONFIG_NO_LEGACY_CONVERSION 1.272 + * This switch turns off all converters except for 1.273 + * - Unicode charsets (UTF-7/8/16/32, CESU-8, SCSU, BOCU-1) 1.274 + * - US-ASCII 1.275 + * - ISO-8859-1 1.276 + * 1.277 + * Turning off legacy conversion is not possible on EBCDIC platforms 1.278 + * because they need ibm-37 or ibm-1047 default converters. 1.279 + * 1.280 + * @stable ICU 2.4 1.281 + */ 1.282 +#ifndef UCONFIG_NO_LEGACY_CONVERSION 1.283 +# define UCONFIG_NO_LEGACY_CONVERSION 0 1.284 +#endif 1.285 + 1.286 +/** 1.287 + * \def UCONFIG_NO_NORMALIZATION 1.288 + * This switch turns off normalization. 1.289 + * It implies turning off several other services as well, for example 1.290 + * collation and IDNA. 1.291 + * 1.292 + * @stable ICU 2.6 1.293 + */ 1.294 +#ifndef UCONFIG_NO_NORMALIZATION 1.295 +# define UCONFIG_NO_NORMALIZATION 0 1.296 +#elif UCONFIG_NO_NORMALIZATION 1.297 + /* common library */ 1.298 + /* ICU 50 CJK dictionary BreakIterator uses normalization */ 1.299 +# define UCONFIG_NO_BREAK_ITERATION 1 1.300 + /* IDNA (UTS #46) is implemented via normalization */ 1.301 +# define UCONFIG_NO_IDNA 1 1.302 + 1.303 + /* i18n library */ 1.304 +# if UCONFIG_ONLY_COLLATION 1.305 +# error Contradictory collation switches in uconfig.h. 1.306 +# endif 1.307 +# define UCONFIG_NO_COLLATION 1 1.308 +# define UCONFIG_NO_TRANSLITERATION 1 1.309 +#endif 1.310 + 1.311 +/** 1.312 + * \def UCONFIG_NO_BREAK_ITERATION 1.313 + * This switch turns off break iteration. 1.314 + * 1.315 + * @stable ICU 2.4 1.316 + */ 1.317 +#ifndef UCONFIG_NO_BREAK_ITERATION 1.318 +# define UCONFIG_NO_BREAK_ITERATION 0 1.319 +#endif 1.320 + 1.321 +/** 1.322 + * \def UCONFIG_NO_IDNA 1.323 + * This switch turns off IDNA. 1.324 + * 1.325 + * @stable ICU 2.6 1.326 + */ 1.327 +#ifndef UCONFIG_NO_IDNA 1.328 +# define UCONFIG_NO_IDNA 0 1.329 +#endif 1.330 + 1.331 +/** 1.332 + * \def UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE 1.333 + * Determines the default UMessagePatternApostropheMode. 1.334 + * See the documentation for that enum. 1.335 + * 1.336 + * @stable ICU 4.8 1.337 + */ 1.338 +#ifndef UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE 1.339 +# define UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE UMSGPAT_APOS_DOUBLE_OPTIONAL 1.340 +#endif 1.341 + 1.342 +/* i18n library switches ---------------------------------------------------- */ 1.343 + 1.344 +/** 1.345 + * \def UCONFIG_NO_COLLATION 1.346 + * This switch turns off collation and collation-based string search. 1.347 + * 1.348 + * @stable ICU 2.4 1.349 + */ 1.350 +#ifndef UCONFIG_NO_COLLATION 1.351 +# define UCONFIG_NO_COLLATION 0 1.352 +#endif 1.353 + 1.354 +/** 1.355 + * \def UCONFIG_NO_FORMATTING 1.356 + * This switch turns off formatting and calendar/timezone services. 1.357 + * 1.358 + * @stable ICU 2.4 1.359 + */ 1.360 +#ifndef UCONFIG_NO_FORMATTING 1.361 +# define UCONFIG_NO_FORMATTING 0 1.362 +#endif 1.363 + 1.364 +/** 1.365 + * \def UCONFIG_NO_TRANSLITERATION 1.366 + * This switch turns off transliteration. 1.367 + * 1.368 + * @stable ICU 2.4 1.369 + */ 1.370 +#ifndef UCONFIG_NO_TRANSLITERATION 1.371 +# define UCONFIG_NO_TRANSLITERATION 0 1.372 +#endif 1.373 + 1.374 +/** 1.375 + * \def UCONFIG_NO_REGULAR_EXPRESSIONS 1.376 + * This switch turns off regular expressions. 1.377 + * 1.378 + * @stable ICU 2.4 1.379 + */ 1.380 +#ifndef UCONFIG_NO_REGULAR_EXPRESSIONS 1.381 +# define UCONFIG_NO_REGULAR_EXPRESSIONS 0 1.382 +#endif 1.383 + 1.384 +/** 1.385 + * \def UCONFIG_NO_SERVICE 1.386 + * This switch turns off service registration. 1.387 + * 1.388 + * @stable ICU 3.2 1.389 + */ 1.390 +#ifndef UCONFIG_NO_SERVICE 1.391 +# define UCONFIG_NO_SERVICE 0 1.392 +#endif 1.393 + 1.394 +/** 1.395 + * \def UCONFIG_HAVE_PARSEALLINPUT 1.396 + * This switch turns on the "parse all input" attribute. Binary incompatible. 1.397 + * 1.398 + * @internal 1.399 + */ 1.400 +#ifndef UCONFIG_HAVE_PARSEALLINPUT 1.401 +# define UCONFIG_HAVE_PARSEALLINPUT 1 1.402 +#endif 1.403 + 1.404 + 1.405 +/** 1.406 + * \def UCONFIG_FORMAT_FASTPATHS_49 1.407 + * This switch turns on other formatting fastpaths. Binary incompatible in object DecimalFormat and DecimalFormatSymbols 1.408 + * 1.409 + * @internal 1.410 + */ 1.411 +#ifndef UCONFIG_FORMAT_FASTPATHS_49 1.412 +# define UCONFIG_FORMAT_FASTPATHS_49 1 1.413 +#endif 1.414 + 1.415 +#endif