]>
Commit | Line | Data |
---|---|---|
f3c0d7a5 A |
1 | // © 2016 and later: Unicode, Inc. and others. |
2 | // License & terms of use: http://www.unicode.org/copyright.html | |
b75a7d8f A |
3 | /* |
4 | ********************************************************************** | |
2ca993e8 | 5 | * Copyright (C) 2002-2016, International Business Machines |
b75a7d8f A |
6 | * Corporation and others. All Rights Reserved. |
7 | ********************************************************************** | |
8 | * file name: uconfig.h | |
f3c0d7a5 | 9 | * encoding: UTF-8 |
b75a7d8f A |
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 | ||
46f4442e | 20 | |
b75a7d8f A |
21 | /*! |
22 | * \file | |
4388f060 | 23 | * \brief User-configurable settings |
b75a7d8f | 24 | * |
4388f060 A |
25 | * Miscellaneous switches: |
26 | * | |
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. | |
30 | * | |
31 | * Switches for excluding parts of ICU library code modules: | |
32 | * | |
33 | * Changing these macros allows building partial, smaller libraries for special purposes. | |
b75a7d8f A |
34 | * By default, all modules are built. |
35 | * The switches are fairly coarse, controlling large modules. | |
36 | * Basic services cannot be turned off. | |
37 | * | |
73c04bcf A |
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. | |
44 | * | |
374ca955 | 45 | * @stable ICU 2.4 |
b75a7d8f A |
46 | */ |
47 | ||
46f4442e | 48 | /** |
46f4442e A |
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. | |
4388f060 | 51 | * |
46f4442e | 52 | * @internal ICU 4.0 |
46f4442e A |
53 | */ |
54 | #if defined(UCONFIG_USE_LOCAL) | |
55 | #include "uconfig_local.h" | |
56 | #endif | |
57 | ||
4388f060 A |
58 | /** |
59 | * \def U_DEBUG | |
60 | * Determines whether to include debugging code. | |
61 | * Automatically set on Windows, but most compilers do not have | |
62 | * related predefined macros. | |
63 | * @internal | |
64 | */ | |
65 | #ifdef U_DEBUG | |
66 | /* Use the predefined value. */ | |
67 | #elif defined(_DEBUG) | |
68 | /* | |
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(). | |
72 | */ | |
73 | # define U_DEBUG 1 | |
74 | # else | |
75 | # define U_DEBUG 0 | |
76 | #endif | |
77 | ||
78 | /** | |
0f5d89e8 | 79 | * Determines whether to enable auto cleanup of libraries. |
4388f060 A |
80 | * @internal |
81 | */ | |
82 | #ifndef UCLN_NO_AUTO_CLEANUP | |
83 | #define UCLN_NO_AUTO_CLEANUP 1 | |
84 | #endif | |
85 | ||
4388f060 A |
86 | /** |
87 | * \def U_DISABLE_RENAMING | |
88 | * Determines whether to disable renaming or not. | |
340931cb | 89 | * (Apple modifies the default to be 1, not 0) |
4388f060 A |
90 | * @internal |
91 | */ | |
92 | #ifndef U_DISABLE_RENAMING | |
2ca993e8 | 93 | #define U_DISABLE_RENAMING 1 |
4388f060 A |
94 | #endif |
95 | ||
96 | /** | |
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. | |
51004dcb | 102 | * @stable ICU 49 |
4388f060 A |
103 | */ |
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 | |
110 | #else | |
111 | # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 0 | |
112 | #endif | |
113 | ||
114 | /** | |
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.) | |
120 | * | |
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. | |
124 | * | |
125 | * @stable ICU 2.2 | |
126 | */ | |
127 | #ifndef U_OVERRIDE_CXX_ALLOCATION | |
128 | #define U_OVERRIDE_CXX_ALLOCATION 1 | |
129 | #endif | |
130 | ||
131 | /** | |
132 | * \def U_ENABLE_TRACING | |
133 | * Determines whether to enable tracing. | |
134 | * @internal | |
135 | */ | |
136 | #ifndef U_ENABLE_TRACING | |
137 | #define U_ENABLE_TRACING 0 | |
138 | #endif | |
139 | ||
2ca993e8 A |
140 | /** |
141 | * \def UCONFIG_ENABLE_PLUGINS | |
142 | * Determines whether to enable ICU plugins. | |
143 | * @internal | |
144 | */ | |
145 | #ifndef UCONFIG_ENABLE_PLUGINS | |
146 | #define UCONFIG_ENABLE_PLUGINS 0 | |
147 | #endif | |
148 | ||
4388f060 A |
149 | /** |
150 | * \def U_ENABLE_DYLOAD | |
151 | * Whether to enable Dynamic loading in ICU. | |
152 | * @internal | |
153 | */ | |
154 | #ifndef U_ENABLE_DYLOAD | |
155 | #define U_ENABLE_DYLOAD 1 | |
156 | #endif | |
157 | ||
158 | /** | |
159 | * \def U_CHECK_DYLOAD | |
160 | * Whether to test Dynamic loading as an OS capability. | |
161 | * @internal | |
162 | */ | |
163 | #ifndef U_CHECK_DYLOAD | |
164 | #define U_CHECK_DYLOAD 1 | |
165 | #endif | |
166 | ||
4388f060 A |
167 | /** |
168 | * \def U_DEFAULT_SHOW_DRAFT | |
169 | * Do we allow ICU users to use the draft APIs by default? | |
170 | * @internal | |
171 | */ | |
172 | #ifndef U_DEFAULT_SHOW_DRAFT | |
173 | #define U_DEFAULT_SHOW_DRAFT 1 | |
174 | #endif | |
175 | ||
176 | /*===========================================================================*/ | |
177 | /* Custom icu entry point renaming */ | |
178 | /*===========================================================================*/ | |
179 | ||
180 | /** | |
181 | * \def U_HAVE_LIB_SUFFIX | |
182 | * 1 if a custom library suffix is set. | |
183 | * @internal | |
184 | */ | |
185 | #ifdef U_HAVE_LIB_SUFFIX | |
186 | /* Use the predefined value. */ | |
3d1f044b | 187 | #elif defined(U_LIB_SUFFIX_C_NAME) || defined(U_IN_DOXYGEN) |
4388f060 A |
188 | # define U_HAVE_LIB_SUFFIX 1 |
189 | #endif | |
190 | ||
191 | /** | |
192 | * \def U_LIB_SUFFIX_C_NAME_STRING | |
193 | * Defines the library suffix as a string with C syntax. | |
194 | * @internal | |
195 | */ | |
196 | #ifdef U_LIB_SUFFIX_C_NAME_STRING | |
197 | /* Use the predefined value. */ | |
198 | #elif defined(U_LIB_SUFFIX_C_NAME) | |
57a6839d A |
199 | # define CONVERT_TO_STRING(s) #s |
200 | # define U_LIB_SUFFIX_C_NAME_STRING CONVERT_TO_STRING(U_LIB_SUFFIX_C_NAME) | |
4388f060 A |
201 | #else |
202 | # define U_LIB_SUFFIX_C_NAME_STRING "" | |
203 | #endif | |
204 | ||
205 | /* common/i18n library switches --------------------------------------------- */ | |
206 | ||
b75a7d8f A |
207 | /** |
208 | * \def UCONFIG_ONLY_COLLATION | |
209 | * This switch turns off modules that are not needed for collation. | |
210 | * | |
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, | |
b331163b | 214 | * then you can define UCONFIG_NO_CONVERSION or UCONFIG_NO_LEGACY_CONVERSION to 1 as well. |
b75a7d8f | 215 | * |
374ca955 | 216 | * @stable ICU 2.4 |
b75a7d8f A |
217 | */ |
218 | #ifndef UCONFIG_ONLY_COLLATION | |
219 | # define UCONFIG_ONLY_COLLATION 0 | |
220 | #endif | |
221 | ||
222 | #if UCONFIG_ONLY_COLLATION | |
223 | /* common library */ | |
224 | # define UCONFIG_NO_BREAK_ITERATION 1 | |
225 | # define UCONFIG_NO_IDNA 1 | |
226 | ||
227 | /* i18n library */ | |
228 | # if UCONFIG_NO_COLLATION | |
229 | # error Contradictory collation switches in uconfig.h. | |
230 | # endif | |
231 | # define UCONFIG_NO_FORMATTING 1 | |
232 | # define UCONFIG_NO_TRANSLITERATION 1 | |
233 | # define UCONFIG_NO_REGULAR_EXPRESSIONS 1 | |
234 | #endif | |
235 | ||
236 | /* common library switches -------------------------------------------------- */ | |
237 | ||
73c04bcf A |
238 | /** |
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(). | |
248 | * | |
249 | * File access is not used at all in the i18n library. | |
250 | * | |
251 | * File access cannot be turned off for the icuio library or for the ICU | |
252 | * test suites and ICU tools. | |
253 | * | |
46f4442e | 254 | * @stable ICU 3.6 |
73c04bcf A |
255 | */ |
256 | #ifndef UCONFIG_NO_FILE_IO | |
257 | # define UCONFIG_NO_FILE_IO 0 | |
258 | #endif | |
259 | ||
b331163b A |
260 | #if UCONFIG_NO_FILE_IO && defined(U_TIMEZONE_FILES_DIR) |
261 | # error Contradictory file io switches in uconfig.h. | |
262 | #endif | |
263 | ||
374ca955 A |
264 | /** |
265 | * \def UCONFIG_NO_CONVERSION | |
0f5d89e8 A |
266 | * ICU will not completely build (compiling the tools fails) with this |
267 | * switch turned on. | |
374ca955 A |
268 | * This switch turns off all converters. |
269 | * | |
729e4ab9 A |
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. | |
272 | * | |
73c04bcf | 273 | * @stable ICU 3.2 |
729e4ab9 | 274 | * @see U_CHARSET_IS_UTF8 |
374ca955 A |
275 | */ |
276 | #ifndef UCONFIG_NO_CONVERSION | |
277 | # define UCONFIG_NO_CONVERSION 0 | |
278 | #endif | |
279 | ||
280 | #if UCONFIG_NO_CONVERSION | |
281 | # define UCONFIG_NO_LEGACY_CONVERSION 1 | |
282 | #endif | |
283 | ||
b331163b A |
284 | /** |
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 | |
289 | * | |
290 | * This is not possible on EBCDIC platforms | |
291 | * because they need ibm-37 or ibm-1047 default converters. | |
292 | * | |
2ca993e8 | 293 | * @stable ICU 55 |
b331163b A |
294 | */ |
295 | #ifndef UCONFIG_ONLY_HTML_CONVERSION | |
296 | # define UCONFIG_ONLY_HTML_CONVERSION 0 | |
297 | #endif | |
298 | ||
b75a7d8f A |
299 | /** |
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) | |
303 | * - US-ASCII | |
304 | * - ISO-8859-1 | |
305 | * | |
306 | * Turning off legacy conversion is not possible on EBCDIC platforms | |
307 | * because they need ibm-37 or ibm-1047 default converters. | |
308 | * | |
374ca955 | 309 | * @stable ICU 2.4 |
b75a7d8f A |
310 | */ |
311 | #ifndef UCONFIG_NO_LEGACY_CONVERSION | |
312 | # define UCONFIG_NO_LEGACY_CONVERSION 0 | |
313 | #endif | |
314 | ||
315 | /** | |
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. | |
320 | * | |
374ca955 | 321 | * @stable ICU 2.6 |
b75a7d8f A |
322 | */ |
323 | #ifndef UCONFIG_NO_NORMALIZATION | |
324 | # define UCONFIG_NO_NORMALIZATION 0 | |
0f5d89e8 A |
325 | #endif |
326 | ||
327 | #if UCONFIG_NO_NORMALIZATION | |
b75a7d8f | 328 | /* common library */ |
51004dcb A |
329 | /* ICU 50 CJK dictionary BreakIterator uses normalization */ |
330 | # define UCONFIG_NO_BREAK_ITERATION 1 | |
331 | /* IDNA (UTS #46) is implemented via normalization */ | |
b75a7d8f A |
332 | # define UCONFIG_NO_IDNA 1 |
333 | ||
334 | /* i18n library */ | |
335 | # if UCONFIG_ONLY_COLLATION | |
336 | # error Contradictory collation switches in uconfig.h. | |
337 | # endif | |
338 | # define UCONFIG_NO_COLLATION 1 | |
339 | # define UCONFIG_NO_TRANSLITERATION 1 | |
340 | #endif | |
341 | ||
342 | /** | |
343 | * \def UCONFIG_NO_BREAK_ITERATION | |
344 | * This switch turns off break iteration. | |
345 | * | |
374ca955 | 346 | * @stable ICU 2.4 |
b75a7d8f A |
347 | */ |
348 | #ifndef UCONFIG_NO_BREAK_ITERATION | |
349 | # define UCONFIG_NO_BREAK_ITERATION 0 | |
350 | #endif | |
351 | ||
352 | /** | |
353 | * \def UCONFIG_NO_IDNA | |
354 | * This switch turns off IDNA. | |
355 | * | |
374ca955 | 356 | * @stable ICU 2.6 |
b75a7d8f A |
357 | */ |
358 | #ifndef UCONFIG_NO_IDNA | |
359 | # define UCONFIG_NO_IDNA 0 | |
360 | #endif | |
361 | ||
4388f060 A |
362 | /** |
363 | * \def UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE | |
364 | * Determines the default UMessagePatternApostropheMode. | |
365 | * See the documentation for that enum. | |
366 | * | |
367 | * @stable ICU 4.8 | |
368 | */ | |
369 | #ifndef UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE | |
370 | # define UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE UMSGPAT_APOS_DOUBLE_OPTIONAL | |
371 | #endif | |
372 | ||
3d1f044b A |
373 | /** |
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. | |
378 | * | |
379 | * @internal ICU 64 | |
380 | */ | |
381 | #ifndef UCONFIG_USE_WINDOWS_LCID_MAPPING_API | |
382 | # define UCONFIG_USE_WINDOWS_LCID_MAPPING_API 1 | |
383 | #endif | |
384 | ||
b75a7d8f A |
385 | /* i18n library switches ---------------------------------------------------- */ |
386 | ||
387 | /** | |
374ca955 | 388 | * \def UCONFIG_NO_COLLATION |
b75a7d8f A |
389 | * This switch turns off collation and collation-based string search. |
390 | * | |
374ca955 | 391 | * @stable ICU 2.4 |
b75a7d8f A |
392 | */ |
393 | #ifndef UCONFIG_NO_COLLATION | |
394 | # define UCONFIG_NO_COLLATION 0 | |
395 | #endif | |
396 | ||
397 | /** | |
398 | * \def UCONFIG_NO_FORMATTING | |
399 | * This switch turns off formatting and calendar/timezone services. | |
400 | * | |
374ca955 | 401 | * @stable ICU 2.4 |
b75a7d8f A |
402 | */ |
403 | #ifndef UCONFIG_NO_FORMATTING | |
404 | # define UCONFIG_NO_FORMATTING 0 | |
405 | #endif | |
406 | ||
407 | /** | |
408 | * \def UCONFIG_NO_TRANSLITERATION | |
409 | * This switch turns off transliteration. | |
410 | * | |
374ca955 | 411 | * @stable ICU 2.4 |
b75a7d8f A |
412 | */ |
413 | #ifndef UCONFIG_NO_TRANSLITERATION | |
414 | # define UCONFIG_NO_TRANSLITERATION 0 | |
415 | #endif | |
416 | ||
417 | /** | |
418 | * \def UCONFIG_NO_REGULAR_EXPRESSIONS | |
419 | * This switch turns off regular expressions. | |
420 | * | |
374ca955 | 421 | * @stable ICU 2.4 |
b75a7d8f A |
422 | */ |
423 | #ifndef UCONFIG_NO_REGULAR_EXPRESSIONS | |
424 | # define UCONFIG_NO_REGULAR_EXPRESSIONS 0 | |
425 | #endif | |
426 | ||
374ca955 A |
427 | /** |
428 | * \def UCONFIG_NO_SERVICE | |
429 | * This switch turns off service registration. | |
340931cb | 430 | * (Apple modifies the default to be 1, not 0) |
374ca955 | 431 | * |
73c04bcf | 432 | * @stable ICU 3.2 |
374ca955 A |
433 | */ |
434 | #ifndef UCONFIG_NO_SERVICE | |
2ca993e8 | 435 | # define UCONFIG_NO_SERVICE 1 |
374ca955 | 436 | #endif |
b75a7d8f | 437 | |
51004dcb A |
438 | /** |
439 | * \def UCONFIG_HAVE_PARSEALLINPUT | |
440 | * This switch turns on the "parse all input" attribute. Binary incompatible. | |
441 | * | |
442 | * @internal | |
443 | */ | |
444 | #ifndef UCONFIG_HAVE_PARSEALLINPUT | |
445 | # define UCONFIG_HAVE_PARSEALLINPUT 1 | |
446 | #endif | |
447 | ||
57a6839d A |
448 | /** |
449 | * \def UCONFIG_NO_FILTERED_BREAK_ITERATION | |
450 | * This switch turns off filtered break iteration code. | |
451 | * | |
452 | * @internal | |
453 | */ | |
454 | #ifndef UCONFIG_NO_FILTERED_BREAK_ITERATION | |
b331163b | 455 | # define UCONFIG_NO_FILTERED_BREAK_ITERATION 0 |
57a6839d A |
456 | #endif |
457 | ||
340931cb | 458 | #endif // __UCONFIG_H__ |