1// © 2016 and later: Unicode, Inc. and others. 2// License & terms of use: http://www.unicode.org/copyright.html 3/* 4********************************************************************** 5* Copyright (C) 2002-2016, International Business Machines 6* Corporation and others. All Rights Reserved. 7********************************************************************** 8* file name: uconfig.h 9* encoding: UTF-8 10* tab size: 8 (not used) 11* indentation:4 12* 13* created on: 2002sep19 14* created by: Markus W. Scherer 15*/ 16 17#ifndef __UCONFIG_H__ 18#define __UCONFIG_H__ 19 20// ohos icu configs 21#define U_DISABLE_RENAMING 1 22#define U_HIDE_DRAFT_API 1 23#define U_HIDE_DEPRECATED_API 1 24#define U_SHOW_CPLUSPLUS_API 0 25#define U_HIDE_INTERNAL_API 1 26#define U_HIDE_OBSOLETE_UTF_OLD_H 1 27#define LIBICU_U_SHOW_CPLUSPLUS_API 0 28 29/*! 30 * \file 31 * \brief User-configurable settings 32 * 33 * Miscellaneous switches: 34 * 35 * A number of macros affect a variety of minor aspects of ICU. 36 * Most of them used to be defined elsewhere (e.g., in utypes.h or platform.h) 37 * and moved here to make them easier to find. 38 * 39 * Switches for excluding parts of ICU library code modules: 40 * 41 * Changing these macros allows building partial, smaller libraries for special purposes. 42 * By default, all modules are built. 43 * The switches are fairly coarse, controlling large modules. 44 * Basic services cannot be turned off. 45 * 46 * Building with any of these options does not guarantee that the 47 * ICU build process will completely work. It is recommended that 48 * the ICU libraries and data be built using the normal build. 49 * At that time you should remove the data used by those services. 50 * After building the ICU data library, you should rebuild the ICU 51 * libraries with these switches customized to your needs. 52 * 53 * @stable ICU 2.4 54 */ 55 56/** 57 * If this switch is defined, ICU will attempt to load a header file named "uconfig_local.h" 58 * prior to determining default settings for uconfig variables. 59 * 60 * @internal ICU 4.0 61 */ 62#if defined(UCONFIG_USE_LOCAL) 63#include "uconfig_local.h" 64#endif 65 66/** 67 * \def U_DEBUG 68 * Determines whether to include debugging code. 69 * Automatically set on Windows, but most compilers do not have 70 * related predefined macros. 71 * @internal 72 */ 73#ifdef U_DEBUG 74 /* Use the predefined value. */ 75#elif defined(_DEBUG) 76 /* 77 * _DEBUG is defined by Visual Studio debug compilation. 78 * Do *not* test for its NDEBUG macro: It is an orthogonal macro 79 * which disables assert(). 80 */ 81# define U_DEBUG 1 82# else 83# define U_DEBUG 0 84#endif 85 86/** 87 * Determines whether to enable auto cleanup of libraries. 88 * @internal 89 */ 90#ifndef UCLN_NO_AUTO_CLEANUP 91#define UCLN_NO_AUTO_CLEANUP 1 92#endif 93 94/** 95 * \def U_NO_DEFAULT_INCLUDE_UTF_HEADERS 96 * Determines whether utypes.h includes utf.h, utf8.h, utf16.h and utf_old.h. 97 * utypes.h includes those headers if this macro is defined to 0. 98 * Otherwise, each those headers must be included explicitly when using one of their macros. 99 * Defaults to 0 for backward compatibility, except inside ICU. 100 * @stable ICU 49 101 */ 102#define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 0 103 104/** 105 * \def U_OVERRIDE_CXX_ALLOCATION 106 * Determines whether to override new and delete. 107 * ICU is normally built such that all of its C++ classes, via their UMemory base, 108 * override operators new and delete to use its internal, customizable, 109 * non-exception-throwing memory allocation functions. (Default value 1 for this macro.) 110 * 111 * This is especially important when the application and its libraries use multiple heaps. 112 * For example, on Windows, this allows the ICU DLL to be used by 113 * applications that statically link the C Runtime library. 114 * 115 * @stable ICU 2.2 116 */ 117#ifndef U_OVERRIDE_CXX_ALLOCATION 118#define U_OVERRIDE_CXX_ALLOCATION 1 119#endif 120 121/** 122 * \def U_ENABLE_TRACING 123 * Determines whether to enable tracing. 124 * @internal 125 */ 126#ifndef U_ENABLE_TRACING 127#define U_ENABLE_TRACING 0 128#endif 129 130/** 131 * \def UCONFIG_ENABLE_PLUGINS 132 * Determines whether to enable ICU plugins. 133 * @internal 134 */ 135#ifndef UCONFIG_ENABLE_PLUGINS 136#define UCONFIG_ENABLE_PLUGINS 0 137#endif 138 139/** 140 * \def U_ENABLE_DYLOAD 141 * Whether to enable Dynamic loading in ICU. 142 * @internal 143 */ 144#ifndef U_ENABLE_DYLOAD 145#define U_ENABLE_DYLOAD 1 146#endif 147 148/** 149 * \def U_CHECK_DYLOAD 150 * Whether to test Dynamic loading as an OS capability. 151 * @internal 152 */ 153#ifndef U_CHECK_DYLOAD 154#define U_CHECK_DYLOAD 1 155#endif 156 157/** 158 * \def U_DEFAULT_SHOW_DRAFT 159 * Do we allow ICU users to use the draft APIs by default? 160 * @internal 161 */ 162#ifndef U_DEFAULT_SHOW_DRAFT 163#define U_DEFAULT_SHOW_DRAFT 1 164#endif 165 166/*===========================================================================*/ 167/* Custom icu entry point renaming */ 168/*===========================================================================*/ 169 170/** 171 * \def U_HAVE_LIB_SUFFIX 172 * 1 if a custom library suffix is set. 173 * @internal 174 */ 175#ifdef U_HAVE_LIB_SUFFIX 176 /* Use the predefined value. */ 177#elif defined(U_LIB_SUFFIX_C_NAME) || defined(U_IN_DOXYGEN) 178# define U_HAVE_LIB_SUFFIX 1 179#endif 180 181/** 182 * \def U_LIB_SUFFIX_C_NAME_STRING 183 * Defines the library suffix as a string with C syntax. 184 * @internal 185 */ 186#ifdef U_LIB_SUFFIX_C_NAME_STRING 187 /* Use the predefined value. */ 188#elif defined(U_LIB_SUFFIX_C_NAME) 189# define CONVERT_TO_STRING(s) #s 190# define U_LIB_SUFFIX_C_NAME_STRING CONVERT_TO_STRING(U_LIB_SUFFIX_C_NAME) 191#else 192# define U_LIB_SUFFIX_C_NAME_STRING "" 193#endif 194 195/* common/i18n library switches --------------------------------------------- */ 196 197/** 198 * \def UCONFIG_ONLY_COLLATION 199 * This switch turns off modules that are not needed for collation. 200 * 201 * It does not turn off legacy conversion because that is necessary 202 * for ICU to work on EBCDIC platforms (for the default converter). 203 * If you want "only collation" and do not build for EBCDIC, 204 * then you can define UCONFIG_NO_CONVERSION or UCONFIG_NO_LEGACY_CONVERSION to 1 as well. 205 * 206 * @stable ICU 2.4 207 */ 208#ifndef UCONFIG_ONLY_COLLATION 209# define UCONFIG_ONLY_COLLATION 0 210#endif 211 212#if UCONFIG_ONLY_COLLATION 213 /* common library */ 214# define UCONFIG_NO_BREAK_ITERATION 1 215# define UCONFIG_NO_IDNA 1 216 217 /* i18n library */ 218# if UCONFIG_NO_COLLATION 219# error Contradictory collation switches in uconfig.h. 220# endif 221# define UCONFIG_NO_FORMATTING 1 222# define UCONFIG_NO_TRANSLITERATION 1 223# define UCONFIG_NO_REGULAR_EXPRESSIONS 1 224#endif 225 226/* common library switches -------------------------------------------------- */ 227 228/** 229 * \def UCONFIG_NO_FILE_IO 230 * This switch turns off all file access in the common library 231 * where file access is only used for data loading. 232 * ICU data must then be provided in the form of a data DLL (or with an 233 * equivalent way to link to the data residing in an executable, 234 * as in building a combined library with both the common library's code and 235 * the data), or via udata_setCommonData(). 236 * Application data must be provided via udata_setAppData() or by using 237 * "open" functions that take pointers to data, for example ucol_openBinary(). 238 * 239 * File access is not used at all in the i18n library. 240 * 241 * File access cannot be turned off for the icuio library or for the ICU 242 * test suites and ICU tools. 243 * 244 * @stable ICU 3.6 245 */ 246#ifndef UCONFIG_NO_FILE_IO 247# define UCONFIG_NO_FILE_IO 0 248#endif 249 250#if UCONFIG_NO_FILE_IO && defined(U_TIMEZONE_FILES_DIR) 251# error Contradictory file io switches in uconfig.h. 252#endif 253 254/** 255 * \def UCONFIG_NO_CONVERSION 256 * ICU will not completely build (compiling the tools fails) with this 257 * switch turned on. 258 * This switch turns off all converters. 259 * 260 * You may want to use this together with U_CHARSET_IS_UTF8 defined to 1 261 * in utypes.h if char* strings in your environment are always in UTF-8. 262 * 263 * @stable ICU 3.2 264 * @see U_CHARSET_IS_UTF8 265 */ 266#ifndef UCONFIG_NO_CONVERSION 267# define UCONFIG_NO_CONVERSION 0 268#endif 269 270#if UCONFIG_NO_CONVERSION 271# define UCONFIG_NO_LEGACY_CONVERSION 1 272#endif 273 274/** 275 * \def UCONFIG_ONLY_HTML_CONVERSION 276 * This switch turns off all of the converters NOT listed in 277 * the HTML encoding standard: 278 * http://www.w3.org/TR/encoding/#names-and-labels 279 * 280 * This is not possible on EBCDIC platforms 281 * because they need ibm-37 or ibm-1047 default converters. 282 * 283 * @stable ICU 55 284 */ 285#ifndef UCONFIG_ONLY_HTML_CONVERSION 286# define UCONFIG_ONLY_HTML_CONVERSION 0 287#endif 288 289/** 290 * \def UCONFIG_NO_LEGACY_CONVERSION 291 * This switch turns off all converters except for 292 * - Unicode charsets (UTF-7/8/16/32, CESU-8, SCSU, BOCU-1) 293 * - US-ASCII 294 * - ISO-8859-1 295 * 296 * Turning off legacy conversion is not possible on EBCDIC platforms 297 * because they need ibm-37 or ibm-1047 default converters. 298 * 299 * @stable ICU 2.4 300 */ 301#ifndef UCONFIG_NO_LEGACY_CONVERSION 302# define UCONFIG_NO_LEGACY_CONVERSION 0 303#endif 304 305/** 306 * \def UCONFIG_NO_NORMALIZATION 307 * This switch turns off normalization. 308 * It implies turning off several other services as well, for example 309 * collation and IDNA. 310 * 311 * @stable ICU 2.6 312 */ 313#ifndef UCONFIG_NO_NORMALIZATION 314# define UCONFIG_NO_NORMALIZATION 0 315#endif 316 317#if UCONFIG_NO_NORMALIZATION 318 /* common library */ 319 /* ICU 50 CJK dictionary BreakIterator uses normalization */ 320# define UCONFIG_NO_BREAK_ITERATION 1 321 /* IDNA (UTS #46) is implemented via normalization */ 322# define UCONFIG_NO_IDNA 1 323 324 /* i18n library */ 325# if UCONFIG_ONLY_COLLATION 326# error Contradictory collation switches in uconfig.h. 327# endif 328# define UCONFIG_NO_COLLATION 1 329# define UCONFIG_NO_TRANSLITERATION 1 330#endif 331 332/** 333 * \def UCONFIG_NO_BREAK_ITERATION 334 * This switch turns off break iteration. 335 * 336 * @stable ICU 2.4 337 */ 338#ifndef UCONFIG_NO_BREAK_ITERATION 339# define UCONFIG_NO_BREAK_ITERATION 0 340#endif 341 342/** 343 * \def UCONFIG_NO_IDNA 344 * This switch turns off IDNA. 345 * 346 * @stable ICU 2.6 347 */ 348#ifndef UCONFIG_NO_IDNA 349# define UCONFIG_NO_IDNA 0 350#endif 351 352/** 353 * \def UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE 354 * Determines the default UMessagePatternApostropheMode. 355 * See the documentation for that enum. 356 * 357 * @stable ICU 4.8 358 */ 359#ifndef UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE 360# define UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE UMSGPAT_APOS_DOUBLE_OPTIONAL 361#endif 362 363/** 364 * \def UCONFIG_USE_WINDOWS_LCID_MAPPING_API 365 * On platforms where U_PLATFORM_HAS_WIN32_API is true, this switch determines 366 * if the Windows platform APIs are used for LCID<->Locale Name conversions. 367 * Otherwise, only the built-in ICU tables are used. 368 * 369 * @internal ICU 64 370 */ 371#ifndef UCONFIG_USE_WINDOWS_LCID_MAPPING_API 372# define UCONFIG_USE_WINDOWS_LCID_MAPPING_API 1 373#endif 374 375/* i18n library switches ---------------------------------------------------- */ 376 377/** 378 * \def UCONFIG_NO_COLLATION 379 * This switch turns off collation and collation-based string search. 380 * 381 * @stable ICU 2.4 382 */ 383#ifndef UCONFIG_NO_COLLATION 384# define UCONFIG_NO_COLLATION 0 385#endif 386 387/** 388 * \def UCONFIG_NO_FORMATTING 389 * This switch turns off formatting and calendar/timezone services. 390 * 391 * @stable ICU 2.4 392 */ 393#ifndef UCONFIG_NO_FORMATTING 394# define UCONFIG_NO_FORMATTING 0 395#endif 396 397/** 398 * \def UCONFIG_NO_TRANSLITERATION 399 * This switch turns off transliteration. 400 * 401 * @stable ICU 2.4 402 */ 403#ifndef UCONFIG_NO_TRANSLITERATION 404# define UCONFIG_NO_TRANSLITERATION 0 405#endif 406 407/** 408 * \def UCONFIG_NO_REGULAR_EXPRESSIONS 409 * This switch turns off regular expressions. 410 * 411 * @stable ICU 2.4 412 */ 413#ifndef UCONFIG_NO_REGULAR_EXPRESSIONS 414# define UCONFIG_NO_REGULAR_EXPRESSIONS 0 415#endif 416 417/** 418 * \def UCONFIG_NO_SERVICE 419 * This switch turns off service registration. 420 * 421 * @stable ICU 3.2 422 */ 423#ifndef UCONFIG_NO_SERVICE 424# define UCONFIG_NO_SERVICE 0 425#endif 426 427/** 428 * \def UCONFIG_HAVE_PARSEALLINPUT 429 * This switch turns on the "parse all input" attribute. Binary incompatible. 430 * 431 * @internal 432 */ 433#ifndef UCONFIG_HAVE_PARSEALLINPUT 434# define UCONFIG_HAVE_PARSEALLINPUT 1 435#endif 436 437/** 438 * \def UCONFIG_NO_FILTERED_BREAK_ITERATION 439 * This switch turns off filtered break iteration code. 440 * 441 * @internal 442 */ 443#ifndef UCONFIG_NO_FILTERED_BREAK_ITERATION 444# define UCONFIG_NO_FILTERED_BREAK_ITERATION 0 445#endif 446 447#endif // __UCONFIG_H__ 448