]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/unicode/uconfig.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 **********************************************************************
5 * Copyright (C) 2002-2016, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
10 * tab size: 8 (not used)
13 * created on: 2002sep19
14 * created by: Markus W. Scherer
23 * \brief User-configurable settings
25 * Miscellaneous switches:
27 * A number of macros affect a variety of minor aspects of ICU.
28 * Most of them used to be defined elsewhere (e.g., in utypes.h or platform.h)
29 * and moved here to make them easier to find.
31 * Switches for excluding parts of ICU library code modules:
33 * Changing these macros allows building partial, smaller libraries for special purposes.
34 * By default, all modules are built.
35 * The switches are fairly coarse, controlling large modules.
36 * Basic services cannot be turned off.
38 * Building with any of these options does not guarantee that the
39 * ICU build process will completely work. It is recommended that
40 * the ICU libraries and data be built using the normal build.
41 * At that time you should remove the data used by those services.
42 * After building the ICU data library, you should rebuild the ICU
43 * libraries with these switches customized to your needs.
49 * If this switch is defined, ICU will attempt to load a header file named "uconfig_local.h"
50 * prior to determining default settings for uconfig variables.
54 #if defined(UCONFIG_USE_LOCAL)
55 #include "uconfig_local.h"
60 * Determines whether to include debugging code.
61 * Automatically set on Windows, but most compilers do not have
62 * related predefined macros.
66 /* Use the predefined value. */
69 * _DEBUG is defined by Visual Studio debug compilation.
70 * Do *not* test for its NDEBUG macro: It is an orthogonal macro
71 * which disables assert().
79 * Determines wheter to enable auto cleanup of libraries.
82 #ifndef UCLN_NO_AUTO_CLEANUP
83 #define UCLN_NO_AUTO_CLEANUP 1
87 * \def U_DISABLE_RENAMING
88 * Determines whether to disable renaming or not.
91 #ifndef U_DISABLE_RENAMING
92 #define U_DISABLE_RENAMING 1
96 * \def U_NO_DEFAULT_INCLUDE_UTF_HEADERS
97 * Determines whether utypes.h includes utf.h, utf8.h, utf16.h and utf_old.h.
98 * utypes.h includes those headers if this macro is defined to 0.
99 * Otherwise, each those headers must be included explicitly when using one of their macros.
100 * Defaults to 0 for backward compatibility, except inside ICU.
103 #ifdef U_NO_DEFAULT_INCLUDE_UTF_HEADERS
104 /* Use the predefined value. */
105 #elif defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || \
106 defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || \
107 defined(U_TOOLUTIL_IMPLEMENTATION)
108 # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 1
110 # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 0
114 * \def U_OVERRIDE_CXX_ALLOCATION
115 * Determines whether to override new and delete.
116 * ICU is normally built such that all of its C++ classes, via their UMemory base,
117 * override operators new and delete to use its internal, customizable,
118 * non-exception-throwing memory allocation functions. (Default value 1 for this macro.)
120 * This is especially important when the application and its libraries use multiple heaps.
121 * For example, on Windows, this allows the ICU DLL to be used by
122 * applications that statically link the C Runtime library.
126 #ifndef U_OVERRIDE_CXX_ALLOCATION
127 #define U_OVERRIDE_CXX_ALLOCATION 1
131 * \def U_ENABLE_TRACING
132 * Determines whether to enable tracing.
135 #ifndef U_ENABLE_TRACING
136 #define U_ENABLE_TRACING 0
140 * \def UCONFIG_ENABLE_PLUGINS
141 * Determines whether to enable ICU plugins.
144 #ifndef UCONFIG_ENABLE_PLUGINS
145 #define UCONFIG_ENABLE_PLUGINS 0
149 * \def U_ENABLE_DYLOAD
150 * Whether to enable Dynamic loading in ICU.
153 #ifndef U_ENABLE_DYLOAD
154 #define U_ENABLE_DYLOAD 1
158 * \def U_CHECK_DYLOAD
159 * Whether to test Dynamic loading as an OS capability.
162 #ifndef U_CHECK_DYLOAD
163 #define U_CHECK_DYLOAD 1
167 * \def U_DEFAULT_SHOW_DRAFT
168 * Do we allow ICU users to use the draft APIs by default?
171 #ifndef U_DEFAULT_SHOW_DRAFT
172 #define U_DEFAULT_SHOW_DRAFT 1
175 /*===========================================================================*/
176 /* Custom icu entry point renaming */
177 /*===========================================================================*/
180 * \def U_HAVE_LIB_SUFFIX
181 * 1 if a custom library suffix is set.
184 #ifdef U_HAVE_LIB_SUFFIX
185 /* Use the predefined value. */
186 #elif defined(U_LIB_SUFFIX_C_NAME)
187 # define U_HAVE_LIB_SUFFIX 1
191 * \def U_LIB_SUFFIX_C_NAME_STRING
192 * Defines the library suffix as a string with C syntax.
195 #ifdef U_LIB_SUFFIX_C_NAME_STRING
196 /* Use the predefined value. */
197 #elif defined(U_LIB_SUFFIX_C_NAME)
198 # define CONVERT_TO_STRING(s) #s
199 # define U_LIB_SUFFIX_C_NAME_STRING CONVERT_TO_STRING(U_LIB_SUFFIX_C_NAME)
201 # define U_LIB_SUFFIX_C_NAME_STRING ""
204 /* common/i18n library switches --------------------------------------------- */
207 * \def UCONFIG_ONLY_COLLATION
208 * This switch turns off modules that are not needed for collation.
210 * It does not turn off legacy conversion because that is necessary
211 * for ICU to work on EBCDIC platforms (for the default converter).
212 * If you want "only collation" and do not build for EBCDIC,
213 * then you can define UCONFIG_NO_CONVERSION or UCONFIG_NO_LEGACY_CONVERSION to 1 as well.
217 #ifndef UCONFIG_ONLY_COLLATION
218 # define UCONFIG_ONLY_COLLATION 0
221 #if UCONFIG_ONLY_COLLATION
223 # define UCONFIG_NO_BREAK_ITERATION 1
224 # define UCONFIG_NO_IDNA 1
227 # if UCONFIG_NO_COLLATION
228 # error Contradictory collation switches in uconfig.h.
230 # define UCONFIG_NO_FORMATTING 1
231 # define UCONFIG_NO_TRANSLITERATION 1
232 # define UCONFIG_NO_REGULAR_EXPRESSIONS 1
235 /* common library switches -------------------------------------------------- */
238 * \def UCONFIG_NO_FILE_IO
239 * This switch turns off all file access in the common library
240 * where file access is only used for data loading.
241 * ICU data must then be provided in the form of a data DLL (or with an
242 * equivalent way to link to the data residing in an executable,
243 * as in building a combined library with both the common library's code and
244 * the data), or via udata_setCommonData().
245 * Application data must be provided via udata_setAppData() or by using
246 * "open" functions that take pointers to data, for example ucol_openBinary().
248 * File access is not used at all in the i18n library.
250 * File access cannot be turned off for the icuio library or for the ICU
251 * test suites and ICU tools.
255 #ifndef UCONFIG_NO_FILE_IO
256 # define UCONFIG_NO_FILE_IO 0
259 #if UCONFIG_NO_FILE_IO && defined(U_TIMEZONE_FILES_DIR)
260 # error Contradictory file io switches in uconfig.h.
264 * \def UCONFIG_NO_CONVERSION
265 * ICU will not completely build with this switch turned on.
266 * This switch turns off all converters.
268 * You may want to use this together with U_CHARSET_IS_UTF8 defined to 1
269 * in utypes.h if char* strings in your environment are always in UTF-8.
272 * @see U_CHARSET_IS_UTF8
274 #ifndef UCONFIG_NO_CONVERSION
275 # define UCONFIG_NO_CONVERSION 0
278 #if UCONFIG_NO_CONVERSION
279 # define UCONFIG_NO_LEGACY_CONVERSION 1
283 * \def UCONFIG_ONLY_HTML_CONVERSION
284 * This switch turns off all of the converters NOT listed in
285 * the HTML encoding standard:
286 * http://www.w3.org/TR/encoding/#names-and-labels
288 * This is not possible on EBCDIC platforms
289 * because they need ibm-37 or ibm-1047 default converters.
293 #ifndef UCONFIG_ONLY_HTML_CONVERSION
294 # define UCONFIG_ONLY_HTML_CONVERSION 0
298 * \def UCONFIG_NO_LEGACY_CONVERSION
299 * This switch turns off all converters except for
300 * - Unicode charsets (UTF-7/8/16/32, CESU-8, SCSU, BOCU-1)
304 * Turning off legacy conversion is not possible on EBCDIC platforms
305 * because they need ibm-37 or ibm-1047 default converters.
309 #ifndef UCONFIG_NO_LEGACY_CONVERSION
310 # define UCONFIG_NO_LEGACY_CONVERSION 0
314 * \def UCONFIG_NO_NORMALIZATION
315 * This switch turns off normalization.
316 * It implies turning off several other services as well, for example
317 * collation and IDNA.
321 #ifndef UCONFIG_NO_NORMALIZATION
322 # define UCONFIG_NO_NORMALIZATION 0
323 #elif UCONFIG_NO_NORMALIZATION
325 /* ICU 50 CJK dictionary BreakIterator uses normalization */
326 # define UCONFIG_NO_BREAK_ITERATION 1
327 /* IDNA (UTS #46) is implemented via normalization */
328 # define UCONFIG_NO_IDNA 1
331 # if UCONFIG_ONLY_COLLATION
332 # error Contradictory collation switches in uconfig.h.
334 # define UCONFIG_NO_COLLATION 1
335 # define UCONFIG_NO_TRANSLITERATION 1
339 * \def UCONFIG_NO_BREAK_ITERATION
340 * This switch turns off break iteration.
344 #ifndef UCONFIG_NO_BREAK_ITERATION
345 # define UCONFIG_NO_BREAK_ITERATION 0
349 * \def UCONFIG_NO_IDNA
350 * This switch turns off IDNA.
354 #ifndef UCONFIG_NO_IDNA
355 # define UCONFIG_NO_IDNA 0
359 * \def UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE
360 * Determines the default UMessagePatternApostropheMode.
361 * See the documentation for that enum.
365 #ifndef UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE
366 # define UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE UMSGPAT_APOS_DOUBLE_OPTIONAL
369 /* i18n library switches ---------------------------------------------------- */
372 * \def UCONFIG_NO_COLLATION
373 * This switch turns off collation and collation-based string search.
377 #ifndef UCONFIG_NO_COLLATION
378 # define UCONFIG_NO_COLLATION 0
382 * \def UCONFIG_NO_FORMATTING
383 * This switch turns off formatting and calendar/timezone services.
387 #ifndef UCONFIG_NO_FORMATTING
388 # define UCONFIG_NO_FORMATTING 0
392 * \def UCONFIG_NO_TRANSLITERATION
393 * This switch turns off transliteration.
397 #ifndef UCONFIG_NO_TRANSLITERATION
398 # define UCONFIG_NO_TRANSLITERATION 0
402 * \def UCONFIG_NO_REGULAR_EXPRESSIONS
403 * This switch turns off regular expressions.
407 #ifndef UCONFIG_NO_REGULAR_EXPRESSIONS
408 # define UCONFIG_NO_REGULAR_EXPRESSIONS 0
412 * \def UCONFIG_NO_SERVICE
413 * This switch turns off service registration.
417 #ifndef UCONFIG_NO_SERVICE
418 # define UCONFIG_NO_SERVICE 1
422 * \def UCONFIG_HAVE_PARSEALLINPUT
423 * This switch turns on the "parse all input" attribute. Binary incompatible.
427 #ifndef UCONFIG_HAVE_PARSEALLINPUT
428 # define UCONFIG_HAVE_PARSEALLINPUT 1
433 * \def UCONFIG_FORMAT_FASTPATHS_49
434 * This switch turns on other formatting fastpaths. Binary incompatible in object DecimalFormat and DecimalFormatSymbols
438 #ifndef UCONFIG_FORMAT_FASTPATHS_49
439 # define UCONFIG_FORMAT_FASTPATHS_49 1
443 * \def UCONFIG_NO_FILTERED_BREAK_ITERATION
444 * This switch turns off filtered break iteration code.
448 #ifndef UCONFIG_NO_FILTERED_BREAK_ITERATION
449 # define UCONFIG_NO_FILTERED_BREAK_ITERATION 0