]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/unicode/uconfig.h
2 **********************************************************************
3 * Copyright (C) 2002-2012, 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 ICU_USE_THREADS
87 * Allows thread support (use of mutexes) to be compiled out of ICU.
88 * Default: use threads.
90 * Even with thread support compiled out, applications may override the
91 * (empty) mutex implementation with the u_setMutexFunctions() functions.
94 #ifdef ICU_USE_THREADS
95 /* Use the predefined value. */
96 #elif defined(APP_NO_THREADS)
97 /* APP_NO_THREADS is an old symbol. We'll honour it if present. */
98 # define ICU_USE_THREADS 0
100 # define ICU_USE_THREADS 1
104 * \def U_DISABLE_RENAMING
105 * Determines whether to disable renaming or not.
108 #ifndef U_DISABLE_RENAMING
109 #define U_DISABLE_RENAMING 0
113 * \def U_NO_DEFAULT_INCLUDE_UTF_HEADERS
114 * Determines whether utypes.h includes utf.h, utf8.h, utf16.h and utf_old.h.
115 * utypes.h includes those headers if this macro is defined to 0.
116 * Otherwise, each those headers must be included explicitly when using one of their macros.
117 * Defaults to 0 for backward compatibility, except inside ICU.
120 #ifdef U_NO_DEFAULT_INCLUDE_UTF_HEADERS
121 /* Use the predefined value. */
122 #elif defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || \
123 defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || \
124 defined(U_TOOLUTIL_IMPLEMENTATION)
125 # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 1
127 # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 0
131 * \def U_OVERRIDE_CXX_ALLOCATION
132 * Determines whether to override new and delete.
133 * ICU is normally built such that all of its C++ classes, via their UMemory base,
134 * override operators new and delete to use its internal, customizable,
135 * non-exception-throwing memory allocation functions. (Default value 1 for this macro.)
137 * This is especially important when the application and its libraries use multiple heaps.
138 * For example, on Windows, this allows the ICU DLL to be used by
139 * applications that statically link the C Runtime library.
143 #ifndef U_OVERRIDE_CXX_ALLOCATION
144 #define U_OVERRIDE_CXX_ALLOCATION 1
148 * \def U_ENABLE_TRACING
149 * Determines whether to enable tracing.
152 #ifndef U_ENABLE_TRACING
153 #define U_ENABLE_TRACING 0
157 * \def U_ENABLE_DYLOAD
158 * Whether to enable Dynamic loading in ICU.
161 #ifndef U_ENABLE_DYLOAD
162 #define U_ENABLE_DYLOAD 1
166 * \def U_CHECK_DYLOAD
167 * Whether to test Dynamic loading as an OS capability.
170 #ifndef U_CHECK_DYLOAD
171 #define U_CHECK_DYLOAD 1
176 * \def U_DEFAULT_SHOW_DRAFT
177 * Do we allow ICU users to use the draft APIs by default?
180 #ifndef U_DEFAULT_SHOW_DRAFT
181 #define U_DEFAULT_SHOW_DRAFT 1
184 /*===========================================================================*/
185 /* Custom icu entry point renaming */
186 /*===========================================================================*/
189 * \def U_HAVE_LIB_SUFFIX
190 * 1 if a custom library suffix is set.
193 #ifdef U_HAVE_LIB_SUFFIX
194 /* Use the predefined value. */
195 #elif defined(U_LIB_SUFFIX_C_NAME)
196 # define U_HAVE_LIB_SUFFIX 1
200 * \def U_LIB_SUFFIX_C_NAME_STRING
201 * Defines the library suffix as a string with C syntax.
204 #ifdef U_LIB_SUFFIX_C_NAME_STRING
205 /* Use the predefined value. */
206 #elif defined(U_LIB_SUFFIX_C_NAME)
207 # define U_LIB_SUFFIX_C_NAME_STRING #U_LIB_SUFFIX_C_NAME
209 # define U_LIB_SUFFIX_C_NAME_STRING ""
212 /* common/i18n library switches --------------------------------------------- */
215 * \def UCONFIG_ONLY_COLLATION
216 * This switch turns off modules that are not needed for collation.
218 * It does not turn off legacy conversion because that is necessary
219 * for ICU to work on EBCDIC platforms (for the default converter).
220 * If you want "only collation" and do not build for EBCDIC,
221 * then you can define UCONFIG_NO_LEGACY_CONVERSION 1 as well.
225 #ifndef UCONFIG_ONLY_COLLATION
226 # define UCONFIG_ONLY_COLLATION 0
229 #if UCONFIG_ONLY_COLLATION
231 # define UCONFIG_NO_BREAK_ITERATION 1
232 # define UCONFIG_NO_IDNA 1
235 # if UCONFIG_NO_COLLATION
236 # error Contradictory collation switches in uconfig.h.
238 # define UCONFIG_NO_FORMATTING 1
239 # define UCONFIG_NO_TRANSLITERATION 1
240 # define UCONFIG_NO_REGULAR_EXPRESSIONS 1
243 /* common library switches -------------------------------------------------- */
246 * \def UCONFIG_NO_FILE_IO
247 * This switch turns off all file access in the common library
248 * where file access is only used for data loading.
249 * ICU data must then be provided in the form of a data DLL (or with an
250 * equivalent way to link to the data residing in an executable,
251 * as in building a combined library with both the common library's code and
252 * the data), or via udata_setCommonData().
253 * Application data must be provided via udata_setAppData() or by using
254 * "open" functions that take pointers to data, for example ucol_openBinary().
256 * File access is not used at all in the i18n library.
258 * File access cannot be turned off for the icuio library or for the ICU
259 * test suites and ICU tools.
263 #ifndef UCONFIG_NO_FILE_IO
264 # define UCONFIG_NO_FILE_IO 0
268 * \def UCONFIG_NO_CONVERSION
269 * ICU will not completely build with this switch turned on.
270 * This switch turns off all converters.
272 * You may want to use this together with U_CHARSET_IS_UTF8 defined to 1
273 * in utypes.h if char* strings in your environment are always in UTF-8.
276 * @see U_CHARSET_IS_UTF8
278 #ifndef UCONFIG_NO_CONVERSION
279 # define UCONFIG_NO_CONVERSION 0
282 #if UCONFIG_NO_CONVERSION
283 # define UCONFIG_NO_LEGACY_CONVERSION 1
287 * \def UCONFIG_NO_LEGACY_CONVERSION
288 * This switch turns off all converters except for
289 * - Unicode charsets (UTF-7/8/16/32, CESU-8, SCSU, BOCU-1)
293 * Turning off legacy conversion is not possible on EBCDIC platforms
294 * because they need ibm-37 or ibm-1047 default converters.
298 #ifndef UCONFIG_NO_LEGACY_CONVERSION
299 # define UCONFIG_NO_LEGACY_CONVERSION 0
303 * \def UCONFIG_NO_NORMALIZATION
304 * This switch turns off normalization.
305 * It implies turning off several other services as well, for example
306 * collation and IDNA.
310 #ifndef UCONFIG_NO_NORMALIZATION
311 # define UCONFIG_NO_NORMALIZATION 0
312 #elif UCONFIG_NO_NORMALIZATION
314 # define UCONFIG_NO_IDNA 1
317 # if UCONFIG_ONLY_COLLATION
318 # error Contradictory collation switches in uconfig.h.
320 # define UCONFIG_NO_COLLATION 1
321 # define UCONFIG_NO_TRANSLITERATION 1
325 * \def UCONFIG_NO_BREAK_ITERATION
326 * This switch turns off break iteration.
330 #ifndef UCONFIG_NO_BREAK_ITERATION
331 # define UCONFIG_NO_BREAK_ITERATION 0
335 * \def UCONFIG_NO_IDNA
336 * This switch turns off IDNA.
340 #ifndef UCONFIG_NO_IDNA
341 # define UCONFIG_NO_IDNA 0
345 * \def UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE
346 * Determines the default UMessagePatternApostropheMode.
347 * See the documentation for that enum.
351 #ifndef UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE
352 # define UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE UMSGPAT_APOS_DOUBLE_OPTIONAL
355 /* i18n library switches ---------------------------------------------------- */
358 * \def UCONFIG_NO_COLLATION
359 * This switch turns off collation and collation-based string search.
363 #ifndef UCONFIG_NO_COLLATION
364 # define UCONFIG_NO_COLLATION 0
368 * \def UCONFIG_NO_FORMATTING
369 * This switch turns off formatting and calendar/timezone services.
373 #ifndef UCONFIG_NO_FORMATTING
374 # define UCONFIG_NO_FORMATTING 0
378 * \def UCONFIG_NO_TRANSLITERATION
379 * This switch turns off transliteration.
383 #ifndef UCONFIG_NO_TRANSLITERATION
384 # define UCONFIG_NO_TRANSLITERATION 0
388 * \def UCONFIG_NO_REGULAR_EXPRESSIONS
389 * This switch turns off regular expressions.
393 #ifndef UCONFIG_NO_REGULAR_EXPRESSIONS
394 # define UCONFIG_NO_REGULAR_EXPRESSIONS 0
398 * \def UCONFIG_NO_SERVICE
399 * This switch turns off service registration.
403 #ifndef UCONFIG_NO_SERVICE
404 # define UCONFIG_NO_SERVICE 0