]> git.saurik.com Git - apple/icu.git/blob - icuSources/common/unicode/uconfig.h
ICU-491.11.2.tar.gz
[apple/icu.git] / icuSources / common / unicode / uconfig.h
1 /*
2 **********************************************************************
3 * Copyright (C) 2002-2012, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 * file name: uconfig.h
7 * encoding: US-ASCII
8 * tab size: 8 (not used)
9 * indentation:4
10 *
11 * created on: 2002sep19
12 * created by: Markus W. Scherer
13 */
14
15 #ifndef __UCONFIG_H__
16 #define __UCONFIG_H__
17
18
19 /*!
20 * \file
21 * \brief User-configurable settings
22 *
23 * Miscellaneous switches:
24 *
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.
28 *
29 * Switches for excluding parts of ICU library code modules:
30 *
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.
35 *
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.
42 *
43 * @stable ICU 2.4
44 */
45
46 /**
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.
49 *
50 * @internal ICU 4.0
51 */
52 #if defined(UCONFIG_USE_LOCAL)
53 #include "uconfig_local.h"
54 #endif
55
56 /**
57 * \def U_DEBUG
58 * Determines whether to include debugging code.
59 * Automatically set on Windows, but most compilers do not have
60 * related predefined macros.
61 * @internal
62 */
63 #ifdef U_DEBUG
64 /* Use the predefined value. */
65 #elif defined(_DEBUG)
66 /*
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().
70 */
71 # define U_DEBUG 1
72 # else
73 # define U_DEBUG 0
74 #endif
75
76 /**
77 * Determines wheter to enable auto cleanup of libraries.
78 * @internal
79 */
80 #ifndef UCLN_NO_AUTO_CLEANUP
81 #define UCLN_NO_AUTO_CLEANUP 1
82 #endif
83
84 /**
85 * \def ICU_USE_THREADS
86 *
87 * Allows thread support (use of mutexes) to be compiled out of ICU.
88 * Default: use threads.
89 *
90 * Even with thread support compiled out, applications may override the
91 * (empty) mutex implementation with the u_setMutexFunctions() functions.
92 * @internal
93 */
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
99 #else
100 # define ICU_USE_THREADS 1
101 #endif
102
103 /**
104 * \def U_DISABLE_RENAMING
105 * Determines whether to disable renaming or not.
106 * @internal
107 */
108 #ifndef U_DISABLE_RENAMING
109 #define U_DISABLE_RENAMING 0
110 #endif
111
112 /**
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.
118 * @draft ICU 49
119 */
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
126 #else
127 # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 0
128 #endif
129
130 /**
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.)
136 *
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.
140 *
141 * @stable ICU 2.2
142 */
143 #ifndef U_OVERRIDE_CXX_ALLOCATION
144 #define U_OVERRIDE_CXX_ALLOCATION 1
145 #endif
146
147 /**
148 * \def U_ENABLE_TRACING
149 * Determines whether to enable tracing.
150 * @internal
151 */
152 #ifndef U_ENABLE_TRACING
153 #define U_ENABLE_TRACING 0
154 #endif
155
156 /**
157 * \def U_ENABLE_DYLOAD
158 * Whether to enable Dynamic loading in ICU.
159 * @internal
160 */
161 #ifndef U_ENABLE_DYLOAD
162 #define U_ENABLE_DYLOAD 1
163 #endif
164
165 /**
166 * \def U_CHECK_DYLOAD
167 * Whether to test Dynamic loading as an OS capability.
168 * @internal
169 */
170 #ifndef U_CHECK_DYLOAD
171 #define U_CHECK_DYLOAD 1
172 #endif
173
174
175 /**
176 * \def U_DEFAULT_SHOW_DRAFT
177 * Do we allow ICU users to use the draft APIs by default?
178 * @internal
179 */
180 #ifndef U_DEFAULT_SHOW_DRAFT
181 #define U_DEFAULT_SHOW_DRAFT 1
182 #endif
183
184 /*===========================================================================*/
185 /* Custom icu entry point renaming */
186 /*===========================================================================*/
187
188 /**
189 * \def U_HAVE_LIB_SUFFIX
190 * 1 if a custom library suffix is set.
191 * @internal
192 */
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
197 #endif
198
199 /**
200 * \def U_LIB_SUFFIX_C_NAME_STRING
201 * Defines the library suffix as a string with C syntax.
202 * @internal
203 */
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
208 #else
209 # define U_LIB_SUFFIX_C_NAME_STRING ""
210 #endif
211
212 /* common/i18n library switches --------------------------------------------- */
213
214 /**
215 * \def UCONFIG_ONLY_COLLATION
216 * This switch turns off modules that are not needed for collation.
217 *
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.
222 *
223 * @stable ICU 2.4
224 */
225 #ifndef UCONFIG_ONLY_COLLATION
226 # define UCONFIG_ONLY_COLLATION 0
227 #endif
228
229 #if UCONFIG_ONLY_COLLATION
230 /* common library */
231 # define UCONFIG_NO_BREAK_ITERATION 1
232 # define UCONFIG_NO_IDNA 1
233
234 /* i18n library */
235 # if UCONFIG_NO_COLLATION
236 # error Contradictory collation switches in uconfig.h.
237 # endif
238 # define UCONFIG_NO_FORMATTING 1
239 # define UCONFIG_NO_TRANSLITERATION 1
240 # define UCONFIG_NO_REGULAR_EXPRESSIONS 1
241 #endif
242
243 /* common library switches -------------------------------------------------- */
244
245 /**
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().
255 *
256 * File access is not used at all in the i18n library.
257 *
258 * File access cannot be turned off for the icuio library or for the ICU
259 * test suites and ICU tools.
260 *
261 * @stable ICU 3.6
262 */
263 #ifndef UCONFIG_NO_FILE_IO
264 # define UCONFIG_NO_FILE_IO 0
265 #endif
266
267 /**
268 * \def UCONFIG_NO_CONVERSION
269 * ICU will not completely build with this switch turned on.
270 * This switch turns off all converters.
271 *
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.
274 *
275 * @stable ICU 3.2
276 * @see U_CHARSET_IS_UTF8
277 */
278 #ifndef UCONFIG_NO_CONVERSION
279 # define UCONFIG_NO_CONVERSION 0
280 #endif
281
282 #if UCONFIG_NO_CONVERSION
283 # define UCONFIG_NO_LEGACY_CONVERSION 1
284 #endif
285
286 /**
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)
290 * - US-ASCII
291 * - ISO-8859-1
292 *
293 * Turning off legacy conversion is not possible on EBCDIC platforms
294 * because they need ibm-37 or ibm-1047 default converters.
295 *
296 * @stable ICU 2.4
297 */
298 #ifndef UCONFIG_NO_LEGACY_CONVERSION
299 # define UCONFIG_NO_LEGACY_CONVERSION 0
300 #endif
301
302 /**
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.
307 *
308 * @stable ICU 2.6
309 */
310 #ifndef UCONFIG_NO_NORMALIZATION
311 # define UCONFIG_NO_NORMALIZATION 0
312 #elif UCONFIG_NO_NORMALIZATION
313 /* common library */
314 # define UCONFIG_NO_IDNA 1
315
316 /* i18n library */
317 # if UCONFIG_ONLY_COLLATION
318 # error Contradictory collation switches in uconfig.h.
319 # endif
320 # define UCONFIG_NO_COLLATION 1
321 # define UCONFIG_NO_TRANSLITERATION 1
322 #endif
323
324 /**
325 * \def UCONFIG_NO_BREAK_ITERATION
326 * This switch turns off break iteration.
327 *
328 * @stable ICU 2.4
329 */
330 #ifndef UCONFIG_NO_BREAK_ITERATION
331 # define UCONFIG_NO_BREAK_ITERATION 0
332 #endif
333
334 /**
335 * \def UCONFIG_NO_IDNA
336 * This switch turns off IDNA.
337 *
338 * @stable ICU 2.6
339 */
340 #ifndef UCONFIG_NO_IDNA
341 # define UCONFIG_NO_IDNA 0
342 #endif
343
344 /**
345 * \def UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE
346 * Determines the default UMessagePatternApostropheMode.
347 * See the documentation for that enum.
348 *
349 * @stable ICU 4.8
350 */
351 #ifndef UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE
352 # define UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE UMSGPAT_APOS_DOUBLE_OPTIONAL
353 #endif
354
355 /* i18n library switches ---------------------------------------------------- */
356
357 /**
358 * \def UCONFIG_NO_COLLATION
359 * This switch turns off collation and collation-based string search.
360 *
361 * @stable ICU 2.4
362 */
363 #ifndef UCONFIG_NO_COLLATION
364 # define UCONFIG_NO_COLLATION 0
365 #endif
366
367 /**
368 * \def UCONFIG_NO_FORMATTING
369 * This switch turns off formatting and calendar/timezone services.
370 *
371 * @stable ICU 2.4
372 */
373 #ifndef UCONFIG_NO_FORMATTING
374 # define UCONFIG_NO_FORMATTING 0
375 #endif
376
377 /**
378 * \def UCONFIG_NO_TRANSLITERATION
379 * This switch turns off transliteration.
380 *
381 * @stable ICU 2.4
382 */
383 #ifndef UCONFIG_NO_TRANSLITERATION
384 # define UCONFIG_NO_TRANSLITERATION 0
385 #endif
386
387 /**
388 * \def UCONFIG_NO_REGULAR_EXPRESSIONS
389 * This switch turns off regular expressions.
390 *
391 * @stable ICU 2.4
392 */
393 #ifndef UCONFIG_NO_REGULAR_EXPRESSIONS
394 # define UCONFIG_NO_REGULAR_EXPRESSIONS 0
395 #endif
396
397 /**
398 * \def UCONFIG_NO_SERVICE
399 * This switch turns off service registration.
400 *
401 * @stable ICU 3.2
402 */
403 #ifndef UCONFIG_NO_SERVICE
404 # define UCONFIG_NO_SERVICE 0
405 #endif
406
407 #endif