]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/unicode/uconfig.h
2 **********************************************************************
3 * Copyright (C) 2002-2015, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
8 * tab size: 8 (not used)
11 * created on: 2002sep19
12 * created by: Markus W. Scherer
21 * \brief User-configurable settings
23 * Miscellaneous switches:
25 * A number of macros affect a variety of minor aspects of ICU.
26 * Most of them used to be defined elsewhere (e.g., in utypes.h or platform.h)
27 * and moved here to make them easier to find.
29 * Switches for excluding parts of ICU library code modules:
31 * Changing these macros allows building partial, smaller libraries for special purposes.
32 * By default, all modules are built.
33 * The switches are fairly coarse, controlling large modules.
34 * Basic services cannot be turned off.
36 * Building with any of these options does not guarantee that the
37 * ICU build process will completely work. It is recommended that
38 * the ICU libraries and data be built using the normal build.
39 * At that time you should remove the data used by those services.
40 * After building the ICU data library, you should rebuild the ICU
41 * libraries with these switches customized to your needs.
47 * If this switch is defined, ICU will attempt to load a header file named "uconfig_local.h"
48 * prior to determining default settings for uconfig variables.
52 #if defined(UCONFIG_USE_LOCAL)
53 #include "uconfig_local.h"
58 * Determines whether to include debugging code.
59 * Automatically set on Windows, but most compilers do not have
60 * related predefined macros.
64 /* Use the predefined value. */
67 * _DEBUG is defined by Visual Studio debug compilation.
68 * Do *not* test for its NDEBUG macro: It is an orthogonal macro
69 * which disables assert().
77 * Determines wheter to enable auto cleanup of libraries.
80 #ifndef UCLN_NO_AUTO_CLEANUP
81 #define UCLN_NO_AUTO_CLEANUP 1
85 * \def U_DISABLE_RENAMING
86 * Determines whether to disable renaming or not.
89 #ifndef U_DISABLE_RENAMING
90 #define U_DISABLE_RENAMING 0
94 * \def U_NO_DEFAULT_INCLUDE_UTF_HEADERS
95 * Determines whether utypes.h includes utf.h, utf8.h, utf16.h and utf_old.h.
96 * utypes.h includes those headers if this macro is defined to 0.
97 * Otherwise, each those headers must be included explicitly when using one of their macros.
98 * Defaults to 0 for backward compatibility, except inside ICU.
101 #ifdef U_NO_DEFAULT_INCLUDE_UTF_HEADERS
102 /* Use the predefined value. */
103 #elif defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || \
104 defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || \
105 defined(U_TOOLUTIL_IMPLEMENTATION)
106 # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 1
108 # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 0
112 * \def U_OVERRIDE_CXX_ALLOCATION
113 * Determines whether to override new and delete.
114 * ICU is normally built such that all of its C++ classes, via their UMemory base,
115 * override operators new and delete to use its internal, customizable,
116 * non-exception-throwing memory allocation functions. (Default value 1 for this macro.)
118 * This is especially important when the application and its libraries use multiple heaps.
119 * For example, on Windows, this allows the ICU DLL to be used by
120 * applications that statically link the C Runtime library.
124 #ifndef U_OVERRIDE_CXX_ALLOCATION
125 #define U_OVERRIDE_CXX_ALLOCATION 1
129 * \def U_ENABLE_TRACING
130 * Determines whether to enable tracing.
133 #ifndef U_ENABLE_TRACING
134 #define U_ENABLE_TRACING 0
138 * \def U_ENABLE_DYLOAD
139 * Whether to enable Dynamic loading in ICU.
142 #ifndef U_ENABLE_DYLOAD
143 #define U_ENABLE_DYLOAD 1
147 * \def U_CHECK_DYLOAD
148 * Whether to test Dynamic loading as an OS capability.
151 #ifndef U_CHECK_DYLOAD
152 #define U_CHECK_DYLOAD 1
157 * \def U_DEFAULT_SHOW_DRAFT
158 * Do we allow ICU users to use the draft APIs by default?
161 #ifndef U_DEFAULT_SHOW_DRAFT
162 #define U_DEFAULT_SHOW_DRAFT 1
165 /*===========================================================================*/
166 /* Custom icu entry point renaming */
167 /*===========================================================================*/
170 * \def U_HAVE_LIB_SUFFIX
171 * 1 if a custom library suffix is set.
174 #ifdef U_HAVE_LIB_SUFFIX
175 /* Use the predefined value. */
176 #elif defined(U_LIB_SUFFIX_C_NAME)
177 # define U_HAVE_LIB_SUFFIX 1
181 * \def U_LIB_SUFFIX_C_NAME_STRING
182 * Defines the library suffix as a string with C syntax.
185 #ifdef U_LIB_SUFFIX_C_NAME_STRING
186 /* Use the predefined value. */
187 #elif defined(U_LIB_SUFFIX_C_NAME)
188 # define CONVERT_TO_STRING(s) #s
189 # define U_LIB_SUFFIX_C_NAME_STRING CONVERT_TO_STRING(U_LIB_SUFFIX_C_NAME)
191 # define U_LIB_SUFFIX_C_NAME_STRING ""
194 /* common/i18n library switches --------------------------------------------- */
197 * \def UCONFIG_ONLY_COLLATION
198 * This switch turns off modules that are not needed for collation.
200 * It does not turn off legacy conversion because that is necessary
201 * for ICU to work on EBCDIC platforms (for the default converter).
202 * If you want "only collation" and do not build for EBCDIC,
203 * then you can define UCONFIG_NO_CONVERSION or UCONFIG_NO_LEGACY_CONVERSION to 1 as well.
207 #ifndef UCONFIG_ONLY_COLLATION
208 # define UCONFIG_ONLY_COLLATION 0
211 #if UCONFIG_ONLY_COLLATION
213 # define UCONFIG_NO_BREAK_ITERATION 1
214 # define UCONFIG_NO_IDNA 1
217 # if UCONFIG_NO_COLLATION
218 # error Contradictory collation switches in uconfig.h.
220 # define UCONFIG_NO_FORMATTING 1
221 # define UCONFIG_NO_TRANSLITERATION 1
222 # define UCONFIG_NO_REGULAR_EXPRESSIONS 1
225 /* common library switches -------------------------------------------------- */
228 * \def UCONFIG_NO_FILE_IO
229 * This switch turns off all file access in the common library
230 * where file access is only used for data loading.
231 * ICU data must then be provided in the form of a data DLL (or with an
232 * equivalent way to link to the data residing in an executable,
233 * as in building a combined library with both the common library's code and
234 * the data), or via udata_setCommonData().
235 * Application data must be provided via udata_setAppData() or by using
236 * "open" functions that take pointers to data, for example ucol_openBinary().
238 * File access is not used at all in the i18n library.
240 * File access cannot be turned off for the icuio library or for the ICU
241 * test suites and ICU tools.
245 #ifndef UCONFIG_NO_FILE_IO
246 # define UCONFIG_NO_FILE_IO 0
249 #if UCONFIG_NO_FILE_IO && defined(U_TIMEZONE_FILES_DIR)
250 # error Contradictory file io switches in uconfig.h.
254 * \def UCONFIG_NO_CONVERSION
255 * ICU will not completely build with this switch turned on.
256 * This switch turns off all converters.
258 * You may want to use this together with U_CHARSET_IS_UTF8 defined to 1
259 * in utypes.h if char* strings in your environment are always in UTF-8.
262 * @see U_CHARSET_IS_UTF8
264 #ifndef UCONFIG_NO_CONVERSION
265 # define UCONFIG_NO_CONVERSION 0
268 #if UCONFIG_NO_CONVERSION
269 # define UCONFIG_NO_LEGACY_CONVERSION 1
273 * \def UCONFIG_ONLY_HTML_CONVERSION
274 * This switch turns off all of the converters NOT listed in
275 * the HTML encoding standard:
276 * http://www.w3.org/TR/encoding/#names-and-labels
278 * This is not possible on EBCDIC platforms
279 * because they need ibm-37 or ibm-1047 default converters.
283 #ifndef UCONFIG_ONLY_HTML_CONVERSION
284 # define UCONFIG_ONLY_HTML_CONVERSION 0
288 * \def UCONFIG_NO_LEGACY_CONVERSION
289 * This switch turns off all converters except for
290 * - Unicode charsets (UTF-7/8/16/32, CESU-8, SCSU, BOCU-1)
294 * Turning off legacy conversion is not possible on EBCDIC platforms
295 * because they need ibm-37 or ibm-1047 default converters.
299 #ifndef UCONFIG_NO_LEGACY_CONVERSION
300 # define UCONFIG_NO_LEGACY_CONVERSION 0
304 * \def UCONFIG_NO_NORMALIZATION
305 * This switch turns off normalization.
306 * It implies turning off several other services as well, for example
307 * collation and IDNA.
311 #ifndef UCONFIG_NO_NORMALIZATION
312 # define UCONFIG_NO_NORMALIZATION 0
313 #elif UCONFIG_NO_NORMALIZATION
315 /* ICU 50 CJK dictionary BreakIterator uses normalization */
316 # define UCONFIG_NO_BREAK_ITERATION 1
317 /* IDNA (UTS #46) is implemented via normalization */
318 # define UCONFIG_NO_IDNA 1
321 # if UCONFIG_ONLY_COLLATION
322 # error Contradictory collation switches in uconfig.h.
324 # define UCONFIG_NO_COLLATION 1
325 # define UCONFIG_NO_TRANSLITERATION 1
329 * \def UCONFIG_NO_BREAK_ITERATION
330 * This switch turns off break iteration.
334 #ifndef UCONFIG_NO_BREAK_ITERATION
335 # define UCONFIG_NO_BREAK_ITERATION 0
339 * \def UCONFIG_NO_IDNA
340 * This switch turns off IDNA.
344 #ifndef UCONFIG_NO_IDNA
345 # define UCONFIG_NO_IDNA 0
349 * \def UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE
350 * Determines the default UMessagePatternApostropheMode.
351 * See the documentation for that enum.
355 #ifndef UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE
356 # define UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE UMSGPAT_APOS_DOUBLE_OPTIONAL
359 /* i18n library switches ---------------------------------------------------- */
362 * \def UCONFIG_NO_COLLATION
363 * This switch turns off collation and collation-based string search.
367 #ifndef UCONFIG_NO_COLLATION
368 # define UCONFIG_NO_COLLATION 0
372 * \def UCONFIG_NO_FORMATTING
373 * This switch turns off formatting and calendar/timezone services.
377 #ifndef UCONFIG_NO_FORMATTING
378 # define UCONFIG_NO_FORMATTING 0
382 * \def UCONFIG_NO_TRANSLITERATION
383 * This switch turns off transliteration.
387 #ifndef UCONFIG_NO_TRANSLITERATION
388 # define UCONFIG_NO_TRANSLITERATION 0
392 * \def UCONFIG_NO_REGULAR_EXPRESSIONS
393 * This switch turns off regular expressions.
397 #ifndef UCONFIG_NO_REGULAR_EXPRESSIONS
398 # define UCONFIG_NO_REGULAR_EXPRESSIONS 0
402 * \def UCONFIG_NO_SERVICE
403 * This switch turns off service registration.
407 #ifndef UCONFIG_NO_SERVICE
408 # define UCONFIG_NO_SERVICE 0
412 * \def UCONFIG_HAVE_PARSEALLINPUT
413 * This switch turns on the "parse all input" attribute. Binary incompatible.
417 #ifndef UCONFIG_HAVE_PARSEALLINPUT
418 # define UCONFIG_HAVE_PARSEALLINPUT 1
423 * \def UCONFIG_FORMAT_FASTPATHS_49
424 * This switch turns on other formatting fastpaths. Binary incompatible in object DecimalFormat and DecimalFormatSymbols
428 #ifndef UCONFIG_FORMAT_FASTPATHS_49
429 # define UCONFIG_FORMAT_FASTPATHS_49 1
433 * \def UCONFIG_NO_FILTERED_BREAK_ITERATION
434 * This switch turns off filtered break iteration code.
438 #ifndef UCONFIG_NO_FILTERED_BREAK_ITERATION
439 # define UCONFIG_NO_FILTERED_BREAK_ITERATION 0