]>
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 whether 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.
89 * (Apple modifies the default to be 1, not 0)
92 #ifndef U_DISABLE_RENAMING
93 #define U_DISABLE_RENAMING 1
97 * \def U_NO_DEFAULT_INCLUDE_UTF_HEADERS
98 * Determines whether utypes.h includes utf.h, utf8.h, utf16.h and utf_old.h.
99 * utypes.h includes those headers if this macro is defined to 0.
100 * Otherwise, each those headers must be included explicitly when using one of their macros.
101 * Defaults to 0 for backward compatibility, except inside ICU.
104 #ifdef U_NO_DEFAULT_INCLUDE_UTF_HEADERS
105 /* Use the predefined value. */
106 #elif defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || \
107 defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || \
108 defined(U_TOOLUTIL_IMPLEMENTATION)
109 # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 1
111 # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 0
115 * \def U_OVERRIDE_CXX_ALLOCATION
116 * Determines whether to override new and delete.
117 * ICU is normally built such that all of its C++ classes, via their UMemory base,
118 * override operators new and delete to use its internal, customizable,
119 * non-exception-throwing memory allocation functions. (Default value 1 for this macro.)
121 * This is especially important when the application and its libraries use multiple heaps.
122 * For example, on Windows, this allows the ICU DLL to be used by
123 * applications that statically link the C Runtime library.
127 #ifndef U_OVERRIDE_CXX_ALLOCATION
128 #define U_OVERRIDE_CXX_ALLOCATION 1
132 * \def U_ENABLE_TRACING
133 * Determines whether to enable tracing.
136 #ifndef U_ENABLE_TRACING
137 #define U_ENABLE_TRACING 0
141 * \def UCONFIG_ENABLE_PLUGINS
142 * Determines whether to enable ICU plugins.
145 #ifndef UCONFIG_ENABLE_PLUGINS
146 #define UCONFIG_ENABLE_PLUGINS 0
150 * \def U_ENABLE_DYLOAD
151 * Whether to enable Dynamic loading in ICU.
154 #ifndef U_ENABLE_DYLOAD
155 #define U_ENABLE_DYLOAD 1
159 * \def U_CHECK_DYLOAD
160 * Whether to test Dynamic loading as an OS capability.
163 #ifndef U_CHECK_DYLOAD
164 #define U_CHECK_DYLOAD 1
168 * \def U_DEFAULT_SHOW_DRAFT
169 * Do we allow ICU users to use the draft APIs by default?
172 #ifndef U_DEFAULT_SHOW_DRAFT
173 #define U_DEFAULT_SHOW_DRAFT 1
176 /*===========================================================================*/
177 /* Custom icu entry point renaming */
178 /*===========================================================================*/
181 * \def U_HAVE_LIB_SUFFIX
182 * 1 if a custom library suffix is set.
185 #ifdef U_HAVE_LIB_SUFFIX
186 /* Use the predefined value. */
187 #elif defined(U_LIB_SUFFIX_C_NAME) || defined(U_IN_DOXYGEN)
188 # define U_HAVE_LIB_SUFFIX 1
192 * \def U_LIB_SUFFIX_C_NAME_STRING
193 * Defines the library suffix as a string with C syntax.
196 #ifdef U_LIB_SUFFIX_C_NAME_STRING
197 /* Use the predefined value. */
198 #elif defined(U_LIB_SUFFIX_C_NAME)
199 # define CONVERT_TO_STRING(s) #s
200 # define U_LIB_SUFFIX_C_NAME_STRING CONVERT_TO_STRING(U_LIB_SUFFIX_C_NAME)
202 # define U_LIB_SUFFIX_C_NAME_STRING ""
205 /* common/i18n library switches --------------------------------------------- */
208 * \def UCONFIG_ONLY_COLLATION
209 * This switch turns off modules that are not needed for collation.
211 * It does not turn off legacy conversion because that is necessary
212 * for ICU to work on EBCDIC platforms (for the default converter).
213 * If you want "only collation" and do not build for EBCDIC,
214 * then you can define UCONFIG_NO_CONVERSION or UCONFIG_NO_LEGACY_CONVERSION to 1 as well.
218 #ifndef UCONFIG_ONLY_COLLATION
219 # define UCONFIG_ONLY_COLLATION 0
222 #if UCONFIG_ONLY_COLLATION
224 # define UCONFIG_NO_BREAK_ITERATION 1
225 # define UCONFIG_NO_IDNA 1
228 # if UCONFIG_NO_COLLATION
229 # error Contradictory collation switches in uconfig.h.
231 # define UCONFIG_NO_FORMATTING 1
232 # define UCONFIG_NO_TRANSLITERATION 1
233 # define UCONFIG_NO_REGULAR_EXPRESSIONS 1
236 /* common library switches -------------------------------------------------- */
239 * \def UCONFIG_NO_FILE_IO
240 * This switch turns off all file access in the common library
241 * where file access is only used for data loading.
242 * ICU data must then be provided in the form of a data DLL (or with an
243 * equivalent way to link to the data residing in an executable,
244 * as in building a combined library with both the common library's code and
245 * the data), or via udata_setCommonData().
246 * Application data must be provided via udata_setAppData() or by using
247 * "open" functions that take pointers to data, for example ucol_openBinary().
249 * File access is not used at all in the i18n library.
251 * File access cannot be turned off for the icuio library or for the ICU
252 * test suites and ICU tools.
256 #ifndef UCONFIG_NO_FILE_IO
257 # define UCONFIG_NO_FILE_IO 0
260 #if UCONFIG_NO_FILE_IO && defined(U_TIMEZONE_FILES_DIR)
261 # error Contradictory file io switches in uconfig.h.
265 * \def UCONFIG_NO_CONVERSION
266 * ICU will not completely build (compiling the tools fails) with this
268 * This switch turns off all converters.
270 * You may want to use this together with U_CHARSET_IS_UTF8 defined to 1
271 * in utypes.h if char* strings in your environment are always in UTF-8.
274 * @see U_CHARSET_IS_UTF8
276 #ifndef UCONFIG_NO_CONVERSION
277 # define UCONFIG_NO_CONVERSION 0
280 #if UCONFIG_NO_CONVERSION
281 # define UCONFIG_NO_LEGACY_CONVERSION 1
285 * \def UCONFIG_ONLY_HTML_CONVERSION
286 * This switch turns off all of the converters NOT listed in
287 * the HTML encoding standard:
288 * http://www.w3.org/TR/encoding/#names-and-labels
290 * This is not possible on EBCDIC platforms
291 * because they need ibm-37 or ibm-1047 default converters.
295 #ifndef UCONFIG_ONLY_HTML_CONVERSION
296 # define UCONFIG_ONLY_HTML_CONVERSION 0
300 * \def UCONFIG_NO_LEGACY_CONVERSION
301 * This switch turns off all converters except for
302 * - Unicode charsets (UTF-7/8/16/32, CESU-8, SCSU, BOCU-1)
306 * Turning off legacy conversion is not possible on EBCDIC platforms
307 * because they need ibm-37 or ibm-1047 default converters.
311 #ifndef UCONFIG_NO_LEGACY_CONVERSION
312 # define UCONFIG_NO_LEGACY_CONVERSION 0
316 * \def UCONFIG_NO_NORMALIZATION
317 * This switch turns off normalization.
318 * It implies turning off several other services as well, for example
319 * collation and IDNA.
323 #ifndef UCONFIG_NO_NORMALIZATION
324 # define UCONFIG_NO_NORMALIZATION 0
327 #if UCONFIG_NO_NORMALIZATION
329 /* ICU 50 CJK dictionary BreakIterator uses normalization */
330 # define UCONFIG_NO_BREAK_ITERATION 1
331 /* IDNA (UTS #46) is implemented via normalization */
332 # define UCONFIG_NO_IDNA 1
335 # if UCONFIG_ONLY_COLLATION
336 # error Contradictory collation switches in uconfig.h.
338 # define UCONFIG_NO_COLLATION 1
339 # define UCONFIG_NO_TRANSLITERATION 1
343 * \def UCONFIG_NO_BREAK_ITERATION
344 * This switch turns off break iteration.
348 #ifndef UCONFIG_NO_BREAK_ITERATION
349 # define UCONFIG_NO_BREAK_ITERATION 0
353 * \def UCONFIG_NO_IDNA
354 * This switch turns off IDNA.
358 #ifndef UCONFIG_NO_IDNA
359 # define UCONFIG_NO_IDNA 0
363 * \def UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE
364 * Determines the default UMessagePatternApostropheMode.
365 * See the documentation for that enum.
369 #ifndef UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE
370 # define UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE UMSGPAT_APOS_DOUBLE_OPTIONAL
374 * \def UCONFIG_USE_WINDOWS_LCID_MAPPING_API
375 * On platforms where U_PLATFORM_HAS_WIN32_API is true, this switch determines
376 * if the Windows platform APIs are used for LCID<->Locale Name conversions.
377 * Otherwise, only the built-in ICU tables are used.
381 #ifndef UCONFIG_USE_WINDOWS_LCID_MAPPING_API
382 # define UCONFIG_USE_WINDOWS_LCID_MAPPING_API 1
385 /* i18n library switches ---------------------------------------------------- */
388 * \def UCONFIG_NO_COLLATION
389 * This switch turns off collation and collation-based string search.
393 #ifndef UCONFIG_NO_COLLATION
394 # define UCONFIG_NO_COLLATION 0
398 * \def UCONFIG_NO_FORMATTING
399 * This switch turns off formatting and calendar/timezone services.
403 #ifndef UCONFIG_NO_FORMATTING
404 # define UCONFIG_NO_FORMATTING 0
408 * \def UCONFIG_NO_TRANSLITERATION
409 * This switch turns off transliteration.
413 #ifndef UCONFIG_NO_TRANSLITERATION
414 # define UCONFIG_NO_TRANSLITERATION 0
418 * \def UCONFIG_NO_REGULAR_EXPRESSIONS
419 * This switch turns off regular expressions.
423 #ifndef UCONFIG_NO_REGULAR_EXPRESSIONS
424 # define UCONFIG_NO_REGULAR_EXPRESSIONS 0
428 * \def UCONFIG_NO_SERVICE
429 * This switch turns off service registration.
430 * (Apple modifies the default to be 1, not 0)
434 #ifndef UCONFIG_NO_SERVICE
435 # define UCONFIG_NO_SERVICE 1
439 * \def UCONFIG_HAVE_PARSEALLINPUT
440 * This switch turns on the "parse all input" attribute. Binary incompatible.
444 #ifndef UCONFIG_HAVE_PARSEALLINPUT
445 # define UCONFIG_HAVE_PARSEALLINPUT 1
449 * \def UCONFIG_NO_FILTERED_BREAK_ITERATION
450 * This switch turns off filtered break iteration code.
454 #ifndef UCONFIG_NO_FILTERED_BREAK_ITERATION
455 # define UCONFIG_NO_FILTERED_BREAK_ITERATION 0
458 #endif // __UCONFIG_H__