uconfig.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. /*
  2. **********************************************************************
  3. * Copyright (C) 2002-2016, 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. #ifndef __UCONFIG_H__
  15. #define __UCONFIG_H__
  16. /*!
  17. * \file
  18. * \brief User-configurable settings
  19. *
  20. * Miscellaneous switches:
  21. *
  22. * A number of macros affect a variety of minor aspects of ICU.
  23. * Most of them used to be defined elsewhere (e.g., in utypes.h or platform.h)
  24. * and moved here to make them easier to find.
  25. *
  26. * Switches for excluding parts of ICU library code modules:
  27. *
  28. * Changing these macros allows building partial, smaller libraries for special purposes.
  29. * By default, all modules are built.
  30. * The switches are fairly coarse, controlling large modules.
  31. * Basic services cannot be turned off.
  32. *
  33. * Building with any of these options does not guarantee that the
  34. * ICU build process will completely work. It is recommended that
  35. * the ICU libraries and data be built using the normal build.
  36. * At that time you should remove the data used by those services.
  37. * After building the ICU data library, you should rebuild the ICU
  38. * libraries with these switches customized to your needs.
  39. *
  40. * @stable ICU 2.4
  41. */
  42. /**
  43. * If this switch is defined, ICU will attempt to load a header file named "uconfig_local.h"
  44. * prior to determining default settings for uconfig variables.
  45. *
  46. * @internal ICU 4.0
  47. */
  48. #if defined(UCONFIG_USE_LOCAL)
  49. #include "uconfig_local.h"
  50. #endif
  51. /**
  52. * \def U_DEBUG
  53. * Determines whether to include debugging code.
  54. * Automatically set on Windows, but most compilers do not have
  55. * related predefined macros.
  56. * @internal
  57. */
  58. #ifdef U_DEBUG
  59. /* Use the predefined value. */
  60. #elif defined(_DEBUG)
  61. /*
  62. * _DEBUG is defined by Visual Studio debug compilation.
  63. * Do *not* test for its NDEBUG macro: It is an orthogonal macro
  64. * which disables assert().
  65. */
  66. # define U_DEBUG 1
  67. # else
  68. # define U_DEBUG 0
  69. #endif
  70. /**
  71. * Determines wheter to enable auto cleanup of libraries.
  72. * @internal
  73. */
  74. #ifndef UCLN_NO_AUTO_CLEANUP
  75. #define UCLN_NO_AUTO_CLEANUP 1
  76. #endif
  77. /**
  78. * \def U_DISABLE_RENAMING
  79. * Determines whether to disable renaming or not.
  80. * @internal
  81. */
  82. #ifndef U_DISABLE_RENAMING
  83. #define U_DISABLE_RENAMING 0
  84. #endif
  85. /**
  86. * \def U_NO_DEFAULT_INCLUDE_UTF_HEADERS
  87. * Determines whether utypes.h includes utf.h, utf8.h, utf16.h and utf_old.h.
  88. * utypes.h includes those headers if this macro is defined to 0.
  89. * Otherwise, each those headers must be included explicitly when using one of their macros.
  90. * Defaults to 0 for backward compatibility, except inside ICU.
  91. * @stable ICU 49
  92. */
  93. #ifdef U_NO_DEFAULT_INCLUDE_UTF_HEADERS
  94. /* Use the predefined value. */
  95. #elif defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || \
  96. defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || \
  97. defined(U_TOOLUTIL_IMPLEMENTATION)
  98. # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 1
  99. #else
  100. # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 0
  101. #endif
  102. /**
  103. * \def U_OVERRIDE_CXX_ALLOCATION
  104. * Determines whether to override new and delete.
  105. * ICU is normally built such that all of its C++ classes, via their UMemory base,
  106. * override operators new and delete to use its internal, customizable,
  107. * non-exception-throwing memory allocation functions. (Default value 1 for this macro.)
  108. *
  109. * This is especially important when the application and its libraries use multiple heaps.
  110. * For example, on Windows, this allows the ICU DLL to be used by
  111. * applications that statically link the C Runtime library.
  112. *
  113. * @stable ICU 2.2
  114. */
  115. #ifndef U_OVERRIDE_CXX_ALLOCATION
  116. #define U_OVERRIDE_CXX_ALLOCATION 1
  117. #endif
  118. /**
  119. * \def U_ENABLE_TRACING
  120. * Determines whether to enable tracing.
  121. * @internal
  122. */
  123. #ifndef U_ENABLE_TRACING
  124. #define U_ENABLE_TRACING 0
  125. #endif
  126. /**
  127. * \def UCONFIG_ENABLE_PLUGINS
  128. * Determines whether to enable ICU plugins.
  129. * @internal
  130. */
  131. #ifndef UCONFIG_ENABLE_PLUGINS
  132. #define UCONFIG_ENABLE_PLUGINS 0
  133. #endif
  134. /**
  135. * \def U_ENABLE_DYLOAD
  136. * Whether to enable Dynamic loading in ICU.
  137. * @internal
  138. */
  139. #ifndef U_ENABLE_DYLOAD
  140. #define U_ENABLE_DYLOAD 1
  141. #endif
  142. /**
  143. * \def U_CHECK_DYLOAD
  144. * Whether to test Dynamic loading as an OS capability.
  145. * @internal
  146. */
  147. #ifndef U_CHECK_DYLOAD
  148. #define U_CHECK_DYLOAD 1
  149. #endif
  150. /**
  151. * \def U_DEFAULT_SHOW_DRAFT
  152. * Do we allow ICU users to use the draft APIs by default?
  153. * @internal
  154. */
  155. #ifndef U_DEFAULT_SHOW_DRAFT
  156. #define U_DEFAULT_SHOW_DRAFT 1
  157. #endif
  158. /*===========================================================================*/
  159. /* Custom icu entry point renaming */
  160. /*===========================================================================*/
  161. /**
  162. * \def U_HAVE_LIB_SUFFIX
  163. * 1 if a custom library suffix is set.
  164. * @internal
  165. */
  166. #ifdef U_HAVE_LIB_SUFFIX
  167. /* Use the predefined value. */
  168. #elif defined(U_LIB_SUFFIX_C_NAME)
  169. # define U_HAVE_LIB_SUFFIX 1
  170. #endif
  171. /**
  172. * \def U_LIB_SUFFIX_C_NAME_STRING
  173. * Defines the library suffix as a string with C syntax.
  174. * @internal
  175. */
  176. #ifdef U_LIB_SUFFIX_C_NAME_STRING
  177. /* Use the predefined value. */
  178. #elif defined(U_LIB_SUFFIX_C_NAME)
  179. # define CONVERT_TO_STRING(s) #s
  180. # define U_LIB_SUFFIX_C_NAME_STRING CONVERT_TO_STRING(U_LIB_SUFFIX_C_NAME)
  181. #else
  182. # define U_LIB_SUFFIX_C_NAME_STRING ""
  183. #endif
  184. /* common/i18n library switches --------------------------------------------- */
  185. /**
  186. * \def UCONFIG_ONLY_COLLATION
  187. * This switch turns off modules that are not needed for collation.
  188. *
  189. * It does not turn off legacy conversion because that is necessary
  190. * for ICU to work on EBCDIC platforms (for the default converter).
  191. * If you want "only collation" and do not build for EBCDIC,
  192. * then you can define UCONFIG_NO_CONVERSION or UCONFIG_NO_LEGACY_CONVERSION to 1 as well.
  193. *
  194. * @stable ICU 2.4
  195. */
  196. #ifndef UCONFIG_ONLY_COLLATION
  197. # define UCONFIG_ONLY_COLLATION 0
  198. #endif
  199. #if UCONFIG_ONLY_COLLATION
  200. /* common library */
  201. # define UCONFIG_NO_BREAK_ITERATION 1
  202. # define UCONFIG_NO_IDNA 1
  203. /* i18n library */
  204. # if UCONFIG_NO_COLLATION
  205. # error Contradictory collation switches in uconfig.h.
  206. # endif
  207. # define UCONFIG_NO_FORMATTING 1
  208. # define UCONFIG_NO_TRANSLITERATION 1
  209. # define UCONFIG_NO_REGULAR_EXPRESSIONS 1
  210. #endif
  211. /* common library switches -------------------------------------------------- */
  212. /**
  213. * \def UCONFIG_NO_FILE_IO
  214. * This switch turns off all file access in the common library
  215. * where file access is only used for data loading.
  216. * ICU data must then be provided in the form of a data DLL (or with an
  217. * equivalent way to link to the data residing in an executable,
  218. * as in building a combined library with both the common library's code and
  219. * the data), or via udata_setCommonData().
  220. * Application data must be provided via udata_setAppData() or by using
  221. * "open" functions that take pointers to data, for example ucol_openBinary().
  222. *
  223. * File access is not used at all in the i18n library.
  224. *
  225. * File access cannot be turned off for the icuio library or for the ICU
  226. * test suites and ICU tools.
  227. *
  228. * @stable ICU 3.6
  229. */
  230. #ifndef UCONFIG_NO_FILE_IO
  231. # define UCONFIG_NO_FILE_IO 0
  232. #endif
  233. #if UCONFIG_NO_FILE_IO && defined(U_TIMEZONE_FILES_DIR)
  234. # error Contradictory file io switches in uconfig.h.
  235. #endif
  236. /**
  237. * \def UCONFIG_NO_CONVERSION
  238. * ICU will not completely build with this switch turned on.
  239. * This switch turns off all converters.
  240. *
  241. * You may want to use this together with U_CHARSET_IS_UTF8 defined to 1
  242. * in utypes.h if char* strings in your environment are always in UTF-8.
  243. *
  244. * @stable ICU 3.2
  245. * @see U_CHARSET_IS_UTF8
  246. */
  247. #ifndef UCONFIG_NO_CONVERSION
  248. # define UCONFIG_NO_CONVERSION 0
  249. #endif
  250. #if UCONFIG_NO_CONVERSION
  251. # define UCONFIG_NO_LEGACY_CONVERSION 1
  252. #endif
  253. /**
  254. * \def UCONFIG_ONLY_HTML_CONVERSION
  255. * This switch turns off all of the converters NOT listed in
  256. * the HTML encoding standard:
  257. * http://www.w3.org/TR/encoding/#names-and-labels
  258. *
  259. * This is not possible on EBCDIC platforms
  260. * because they need ibm-37 or ibm-1047 default converters.
  261. *
  262. * @stable ICU 55
  263. */
  264. #ifndef UCONFIG_ONLY_HTML_CONVERSION
  265. # define UCONFIG_ONLY_HTML_CONVERSION 0
  266. #endif
  267. /**
  268. * \def UCONFIG_NO_LEGACY_CONVERSION
  269. * This switch turns off all converters except for
  270. * - Unicode charsets (UTF-7/8/16/32, CESU-8, SCSU, BOCU-1)
  271. * - US-ASCII
  272. * - ISO-8859-1
  273. *
  274. * Turning off legacy conversion is not possible on EBCDIC platforms
  275. * because they need ibm-37 or ibm-1047 default converters.
  276. *
  277. * @stable ICU 2.4
  278. */
  279. #ifndef UCONFIG_NO_LEGACY_CONVERSION
  280. # define UCONFIG_NO_LEGACY_CONVERSION 0
  281. #endif
  282. /**
  283. * \def UCONFIG_NO_NORMALIZATION
  284. * This switch turns off normalization.
  285. * It implies turning off several other services as well, for example
  286. * collation and IDNA.
  287. *
  288. * @stable ICU 2.6
  289. */
  290. #ifndef UCONFIG_NO_NORMALIZATION
  291. # define UCONFIG_NO_NORMALIZATION 0
  292. #elif UCONFIG_NO_NORMALIZATION
  293. /* common library */
  294. /* ICU 50 CJK dictionary BreakIterator uses normalization */
  295. # define UCONFIG_NO_BREAK_ITERATION 1
  296. /* IDNA (UTS #46) is implemented via normalization */
  297. # define UCONFIG_NO_IDNA 1
  298. /* i18n library */
  299. # if UCONFIG_ONLY_COLLATION
  300. # error Contradictory collation switches in uconfig.h.
  301. # endif
  302. # define UCONFIG_NO_COLLATION 1
  303. # define UCONFIG_NO_TRANSLITERATION 1
  304. #endif
  305. /**
  306. * \def UCONFIG_NO_BREAK_ITERATION
  307. * This switch turns off break iteration.
  308. *
  309. * @stable ICU 2.4
  310. */
  311. #ifndef UCONFIG_NO_BREAK_ITERATION
  312. # define UCONFIG_NO_BREAK_ITERATION 0
  313. #endif
  314. /**
  315. * \def UCONFIG_NO_IDNA
  316. * This switch turns off IDNA.
  317. *
  318. * @stable ICU 2.6
  319. */
  320. #ifndef UCONFIG_NO_IDNA
  321. # define UCONFIG_NO_IDNA 0
  322. #endif
  323. /**
  324. * \def UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE
  325. * Determines the default UMessagePatternApostropheMode.
  326. * See the documentation for that enum.
  327. *
  328. * @stable ICU 4.8
  329. */
  330. #ifndef UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE
  331. # define UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE UMSGPAT_APOS_DOUBLE_OPTIONAL
  332. #endif
  333. /* i18n library switches ---------------------------------------------------- */
  334. /**
  335. * \def UCONFIG_NO_COLLATION
  336. * This switch turns off collation and collation-based string search.
  337. *
  338. * @stable ICU 2.4
  339. */
  340. #ifndef UCONFIG_NO_COLLATION
  341. # define UCONFIG_NO_COLLATION 0
  342. #endif
  343. /**
  344. * \def UCONFIG_NO_FORMATTING
  345. * This switch turns off formatting and calendar/timezone services.
  346. *
  347. * @stable ICU 2.4
  348. */
  349. #ifndef UCONFIG_NO_FORMATTING
  350. # define UCONFIG_NO_FORMATTING 0
  351. #endif
  352. /**
  353. * \def UCONFIG_NO_TRANSLITERATION
  354. * This switch turns off transliteration.
  355. *
  356. * @stable ICU 2.4
  357. */
  358. #ifndef UCONFIG_NO_TRANSLITERATION
  359. # define UCONFIG_NO_TRANSLITERATION 0
  360. #endif
  361. /**
  362. * \def UCONFIG_NO_REGULAR_EXPRESSIONS
  363. * This switch turns off regular expressions.
  364. *
  365. * @stable ICU 2.4
  366. */
  367. #ifndef UCONFIG_NO_REGULAR_EXPRESSIONS
  368. # define UCONFIG_NO_REGULAR_EXPRESSIONS 0
  369. #endif
  370. /**
  371. * \def UCONFIG_NO_SERVICE
  372. * This switch turns off service registration.
  373. *
  374. * @stable ICU 3.2
  375. */
  376. #ifndef UCONFIG_NO_SERVICE
  377. # define UCONFIG_NO_SERVICE 0
  378. #endif
  379. /**
  380. * \def UCONFIG_HAVE_PARSEALLINPUT
  381. * This switch turns on the "parse all input" attribute. Binary incompatible.
  382. *
  383. * @internal
  384. */
  385. #ifndef UCONFIG_HAVE_PARSEALLINPUT
  386. # define UCONFIG_HAVE_PARSEALLINPUT 1
  387. #endif
  388. /**
  389. * \def UCONFIG_FORMAT_FASTPATHS_49
  390. * This switch turns on other formatting fastpaths. Binary incompatible in object DecimalFormat and DecimalFormatSymbols
  391. *
  392. * @internal
  393. */
  394. #ifndef UCONFIG_FORMAT_FASTPATHS_49
  395. # define UCONFIG_FORMAT_FASTPATHS_49 1
  396. #endif
  397. /**
  398. * \def UCONFIG_NO_FILTERED_BREAK_ITERATION
  399. * This switch turns off filtered break iteration code.
  400. *
  401. * @internal
  402. */
  403. #ifndef UCONFIG_NO_FILTERED_BREAK_ITERATION
  404. # define UCONFIG_NO_FILTERED_BREAK_ITERATION 0
  405. #endif
  406. #endif