jpayne@69: // © 2016 and later: Unicode, Inc. and others. jpayne@69: // License & terms of use: http://www.unicode.org/copyright.html jpayne@69: /* jpayne@69: ********************************************************************** jpayne@69: * Copyright (C) 2002-2016, International Business Machines jpayne@69: * Corporation and others. All Rights Reserved. jpayne@69: ********************************************************************** jpayne@69: * file name: uconfig.h jpayne@69: * encoding: UTF-8 jpayne@69: * tab size: 8 (not used) jpayne@69: * indentation:4 jpayne@69: * jpayne@69: * created on: 2002sep19 jpayne@69: * created by: Markus W. Scherer jpayne@69: */ jpayne@69: jpayne@69: #ifndef __UCONFIG_H__ jpayne@69: #define __UCONFIG_H__ jpayne@69: jpayne@69: jpayne@69: /*! jpayne@69: * \file jpayne@69: * \brief User-configurable settings jpayne@69: * jpayne@69: * Miscellaneous switches: jpayne@69: * jpayne@69: * A number of macros affect a variety of minor aspects of ICU. jpayne@69: * Most of them used to be defined elsewhere (e.g., in utypes.h or platform.h) jpayne@69: * and moved here to make them easier to find. jpayne@69: * jpayne@69: * Switches for excluding parts of ICU library code modules: jpayne@69: * jpayne@69: * Changing these macros allows building partial, smaller libraries for special purposes. jpayne@69: * By default, all modules are built. jpayne@69: * The switches are fairly coarse, controlling large modules. jpayne@69: * Basic services cannot be turned off. jpayne@69: * jpayne@69: * Building with any of these options does not guarantee that the jpayne@69: * ICU build process will completely work. It is recommended that jpayne@69: * the ICU libraries and data be built using the normal build. jpayne@69: * At that time you should remove the data used by those services. jpayne@69: * After building the ICU data library, you should rebuild the ICU jpayne@69: * libraries with these switches customized to your needs. jpayne@69: * jpayne@69: * @stable ICU 2.4 jpayne@69: */ jpayne@69: jpayne@69: /** jpayne@69: * If this switch is defined, ICU will attempt to load a header file named "uconfig_local.h" jpayne@69: * prior to determining default settings for uconfig variables. jpayne@69: * jpayne@69: * @internal ICU 4.0 jpayne@69: */ jpayne@69: #if defined(UCONFIG_USE_LOCAL) jpayne@69: #include "uconfig_local.h" jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def U_DEBUG jpayne@69: * Determines whether to include debugging code. jpayne@69: * Automatically set on Windows, but most compilers do not have jpayne@69: * related predefined macros. jpayne@69: * @internal jpayne@69: */ jpayne@69: #ifdef U_DEBUG jpayne@69: /* Use the predefined value. */ jpayne@69: #elif defined(_DEBUG) jpayne@69: /* jpayne@69: * _DEBUG is defined by Visual Studio debug compilation. jpayne@69: * Do *not* test for its NDEBUG macro: It is an orthogonal macro jpayne@69: * which disables assert(). jpayne@69: */ jpayne@69: # define U_DEBUG 1 jpayne@69: # else jpayne@69: # define U_DEBUG 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * Determines whether to enable auto cleanup of libraries. jpayne@69: * @internal jpayne@69: */ jpayne@69: #ifndef UCLN_NO_AUTO_CLEANUP jpayne@69: #define UCLN_NO_AUTO_CLEANUP 1 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def U_DISABLE_RENAMING jpayne@69: * Determines whether to disable renaming or not. jpayne@69: * @internal jpayne@69: */ jpayne@69: #ifndef U_DISABLE_RENAMING jpayne@69: #define U_DISABLE_RENAMING 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def U_NO_DEFAULT_INCLUDE_UTF_HEADERS jpayne@69: * Determines whether utypes.h includes utf.h, utf8.h, utf16.h and utf_old.h. jpayne@69: * utypes.h includes those headers if this macro is defined to 0. jpayne@69: * Otherwise, each those headers must be included explicitly when using one of their macros. jpayne@69: * Defaults to 0 for backward compatibility, except inside ICU. jpayne@69: * @stable ICU 49 jpayne@69: */ jpayne@69: #ifdef U_NO_DEFAULT_INCLUDE_UTF_HEADERS jpayne@69: /* Use the predefined value. */ jpayne@69: #elif defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || \ jpayne@69: defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || \ jpayne@69: defined(U_TOOLUTIL_IMPLEMENTATION) jpayne@69: # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 1 jpayne@69: #else jpayne@69: # define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def U_OVERRIDE_CXX_ALLOCATION jpayne@69: * Determines whether to override new and delete. jpayne@69: * ICU is normally built such that all of its C++ classes, via their UMemory base, jpayne@69: * override operators new and delete to use its internal, customizable, jpayne@69: * non-exception-throwing memory allocation functions. (Default value 1 for this macro.) jpayne@69: * jpayne@69: * This is especially important when the application and its libraries use multiple heaps. jpayne@69: * For example, on Windows, this allows the ICU DLL to be used by jpayne@69: * applications that statically link the C Runtime library. jpayne@69: * jpayne@69: * @stable ICU 2.2 jpayne@69: */ jpayne@69: #ifndef U_OVERRIDE_CXX_ALLOCATION jpayne@69: #define U_OVERRIDE_CXX_ALLOCATION 1 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def U_ENABLE_TRACING jpayne@69: * Determines whether to enable tracing. jpayne@69: * @internal jpayne@69: */ jpayne@69: #ifndef U_ENABLE_TRACING jpayne@69: #define U_ENABLE_TRACING 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_ENABLE_PLUGINS jpayne@69: * Determines whether to enable ICU plugins. jpayne@69: * @internal jpayne@69: */ jpayne@69: #ifndef UCONFIG_ENABLE_PLUGINS jpayne@69: #define UCONFIG_ENABLE_PLUGINS 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def U_ENABLE_DYLOAD jpayne@69: * Whether to enable Dynamic loading in ICU. jpayne@69: * @internal jpayne@69: */ jpayne@69: #ifndef U_ENABLE_DYLOAD jpayne@69: #define U_ENABLE_DYLOAD 1 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def U_CHECK_DYLOAD jpayne@69: * Whether to test Dynamic loading as an OS capability. jpayne@69: * @internal jpayne@69: */ jpayne@69: #ifndef U_CHECK_DYLOAD jpayne@69: #define U_CHECK_DYLOAD 1 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def U_DEFAULT_SHOW_DRAFT jpayne@69: * Do we allow ICU users to use the draft APIs by default? jpayne@69: * @internal jpayne@69: */ jpayne@69: #ifndef U_DEFAULT_SHOW_DRAFT jpayne@69: #define U_DEFAULT_SHOW_DRAFT 1 jpayne@69: #endif jpayne@69: jpayne@69: /*===========================================================================*/ jpayne@69: /* Custom icu entry point renaming */ jpayne@69: /*===========================================================================*/ jpayne@69: jpayne@69: /** jpayne@69: * \def U_HAVE_LIB_SUFFIX jpayne@69: * 1 if a custom library suffix is set. jpayne@69: * @internal jpayne@69: */ jpayne@69: #ifdef U_HAVE_LIB_SUFFIX jpayne@69: /* Use the predefined value. */ jpayne@69: #elif defined(U_LIB_SUFFIX_C_NAME) || defined(U_IN_DOXYGEN) jpayne@69: # define U_HAVE_LIB_SUFFIX 1 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def U_LIB_SUFFIX_C_NAME_STRING jpayne@69: * Defines the library suffix as a string with C syntax. jpayne@69: * @internal jpayne@69: */ jpayne@69: #ifdef U_LIB_SUFFIX_C_NAME_STRING jpayne@69: /* Use the predefined value. */ jpayne@69: #elif defined(U_LIB_SUFFIX_C_NAME) jpayne@69: # define CONVERT_TO_STRING(s) #s jpayne@69: # define U_LIB_SUFFIX_C_NAME_STRING CONVERT_TO_STRING(U_LIB_SUFFIX_C_NAME) jpayne@69: #else jpayne@69: # define U_LIB_SUFFIX_C_NAME_STRING "" jpayne@69: #endif jpayne@69: jpayne@69: /* common/i18n library switches --------------------------------------------- */ jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_ONLY_COLLATION jpayne@69: * This switch turns off modules that are not needed for collation. jpayne@69: * jpayne@69: * It does not turn off legacy conversion because that is necessary jpayne@69: * for ICU to work on EBCDIC platforms (for the default converter). jpayne@69: * If you want "only collation" and do not build for EBCDIC, jpayne@69: * then you can define UCONFIG_NO_CONVERSION or UCONFIG_NO_LEGACY_CONVERSION to 1 as well. jpayne@69: * jpayne@69: * @stable ICU 2.4 jpayne@69: */ jpayne@69: #ifndef UCONFIG_ONLY_COLLATION jpayne@69: # define UCONFIG_ONLY_COLLATION 0 jpayne@69: #endif jpayne@69: jpayne@69: #if UCONFIG_ONLY_COLLATION jpayne@69: /* common library */ jpayne@69: # define UCONFIG_NO_BREAK_ITERATION 1 jpayne@69: # define UCONFIG_NO_IDNA 1 jpayne@69: jpayne@69: /* i18n library */ jpayne@69: # if UCONFIG_NO_COLLATION jpayne@69: # error Contradictory collation switches in uconfig.h. jpayne@69: # endif jpayne@69: # define UCONFIG_NO_FORMATTING 1 jpayne@69: # define UCONFIG_NO_TRANSLITERATION 1 jpayne@69: # define UCONFIG_NO_REGULAR_EXPRESSIONS 1 jpayne@69: #endif jpayne@69: jpayne@69: /* common library switches -------------------------------------------------- */ jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_NO_FILE_IO jpayne@69: * This switch turns off all file access in the common library jpayne@69: * where file access is only used for data loading. jpayne@69: * ICU data must then be provided in the form of a data DLL (or with an jpayne@69: * equivalent way to link to the data residing in an executable, jpayne@69: * as in building a combined library with both the common library's code and jpayne@69: * the data), or via udata_setCommonData(). jpayne@69: * Application data must be provided via udata_setAppData() or by using jpayne@69: * "open" functions that take pointers to data, for example ucol_openBinary(). jpayne@69: * jpayne@69: * File access is not used at all in the i18n library. jpayne@69: * jpayne@69: * File access cannot be turned off for the icuio library or for the ICU jpayne@69: * test suites and ICU tools. jpayne@69: * jpayne@69: * @stable ICU 3.6 jpayne@69: */ jpayne@69: #ifndef UCONFIG_NO_FILE_IO jpayne@69: # define UCONFIG_NO_FILE_IO 0 jpayne@69: #endif jpayne@69: jpayne@69: #if UCONFIG_NO_FILE_IO && defined(U_TIMEZONE_FILES_DIR) jpayne@69: # error Contradictory file io switches in uconfig.h. jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_NO_CONVERSION jpayne@69: * ICU will not completely build (compiling the tools fails) with this jpayne@69: * switch turned on. jpayne@69: * This switch turns off all converters. jpayne@69: * jpayne@69: * You may want to use this together with U_CHARSET_IS_UTF8 defined to 1 jpayne@69: * in utypes.h if char* strings in your environment are always in UTF-8. jpayne@69: * jpayne@69: * @stable ICU 3.2 jpayne@69: * @see U_CHARSET_IS_UTF8 jpayne@69: */ jpayne@69: #ifndef UCONFIG_NO_CONVERSION jpayne@69: # define UCONFIG_NO_CONVERSION 0 jpayne@69: #endif jpayne@69: jpayne@69: #if UCONFIG_NO_CONVERSION jpayne@69: # define UCONFIG_NO_LEGACY_CONVERSION 1 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_ONLY_HTML_CONVERSION jpayne@69: * This switch turns off all of the converters NOT listed in jpayne@69: * the HTML encoding standard: jpayne@69: * http://www.w3.org/TR/encoding/#names-and-labels jpayne@69: * jpayne@69: * This is not possible on EBCDIC platforms jpayne@69: * because they need ibm-37 or ibm-1047 default converters. jpayne@69: * jpayne@69: * @stable ICU 55 jpayne@69: */ jpayne@69: #ifndef UCONFIG_ONLY_HTML_CONVERSION jpayne@69: # define UCONFIG_ONLY_HTML_CONVERSION 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_NO_LEGACY_CONVERSION jpayne@69: * This switch turns off all converters except for jpayne@69: * - Unicode charsets (UTF-7/8/16/32, CESU-8, SCSU, BOCU-1) jpayne@69: * - US-ASCII jpayne@69: * - ISO-8859-1 jpayne@69: * jpayne@69: * Turning off legacy conversion is not possible on EBCDIC platforms jpayne@69: * because they need ibm-37 or ibm-1047 default converters. jpayne@69: * jpayne@69: * @stable ICU 2.4 jpayne@69: */ jpayne@69: #ifndef UCONFIG_NO_LEGACY_CONVERSION jpayne@69: # define UCONFIG_NO_LEGACY_CONVERSION 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_NO_NORMALIZATION jpayne@69: * This switch turns off normalization. jpayne@69: * It implies turning off several other services as well, for example jpayne@69: * collation and IDNA. jpayne@69: * jpayne@69: * @stable ICU 2.6 jpayne@69: */ jpayne@69: #ifndef UCONFIG_NO_NORMALIZATION jpayne@69: # define UCONFIG_NO_NORMALIZATION 0 jpayne@69: #endif jpayne@69: jpayne@69: #if UCONFIG_NO_NORMALIZATION jpayne@69: /* common library */ jpayne@69: /* ICU 50 CJK dictionary BreakIterator uses normalization */ jpayne@69: # define UCONFIG_NO_BREAK_ITERATION 1 jpayne@69: /* IDNA (UTS #46) is implemented via normalization */ jpayne@69: # define UCONFIG_NO_IDNA 1 jpayne@69: jpayne@69: /* i18n library */ jpayne@69: # if UCONFIG_ONLY_COLLATION jpayne@69: # error Contradictory collation switches in uconfig.h. jpayne@69: # endif jpayne@69: # define UCONFIG_NO_COLLATION 1 jpayne@69: # define UCONFIG_NO_TRANSLITERATION 1 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_NO_BREAK_ITERATION jpayne@69: * This switch turns off break iteration. jpayne@69: * jpayne@69: * @stable ICU 2.4 jpayne@69: */ jpayne@69: #ifndef UCONFIG_NO_BREAK_ITERATION jpayne@69: # define UCONFIG_NO_BREAK_ITERATION 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_NO_IDNA jpayne@69: * This switch turns off IDNA. jpayne@69: * jpayne@69: * @stable ICU 2.6 jpayne@69: */ jpayne@69: #ifndef UCONFIG_NO_IDNA jpayne@69: # define UCONFIG_NO_IDNA 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE jpayne@69: * Determines the default UMessagePatternApostropheMode. jpayne@69: * See the documentation for that enum. jpayne@69: * jpayne@69: * @stable ICU 4.8 jpayne@69: */ jpayne@69: #ifndef UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE jpayne@69: # define UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE UMSGPAT_APOS_DOUBLE_OPTIONAL jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_USE_WINDOWS_LCID_MAPPING_API jpayne@69: * On platforms where U_PLATFORM_HAS_WIN32_API is true, this switch determines jpayne@69: * if the Windows platform APIs are used for LCID<->Locale Name conversions. jpayne@69: * Otherwise, only the built-in ICU tables are used. jpayne@69: * jpayne@69: * @internal ICU 64 jpayne@69: */ jpayne@69: #ifndef UCONFIG_USE_WINDOWS_LCID_MAPPING_API jpayne@69: # define UCONFIG_USE_WINDOWS_LCID_MAPPING_API 1 jpayne@69: #endif jpayne@69: jpayne@69: /* i18n library switches ---------------------------------------------------- */ jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_NO_COLLATION jpayne@69: * This switch turns off collation and collation-based string search. jpayne@69: * jpayne@69: * @stable ICU 2.4 jpayne@69: */ jpayne@69: #ifndef UCONFIG_NO_COLLATION jpayne@69: # define UCONFIG_NO_COLLATION 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_NO_FORMATTING jpayne@69: * This switch turns off formatting and calendar/timezone services. jpayne@69: * jpayne@69: * @stable ICU 2.4 jpayne@69: */ jpayne@69: #ifndef UCONFIG_NO_FORMATTING jpayne@69: # define UCONFIG_NO_FORMATTING 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_NO_TRANSLITERATION jpayne@69: * This switch turns off transliteration. jpayne@69: * jpayne@69: * @stable ICU 2.4 jpayne@69: */ jpayne@69: #ifndef UCONFIG_NO_TRANSLITERATION jpayne@69: # define UCONFIG_NO_TRANSLITERATION 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_NO_REGULAR_EXPRESSIONS jpayne@69: * This switch turns off regular expressions. jpayne@69: * jpayne@69: * @stable ICU 2.4 jpayne@69: */ jpayne@69: #ifndef UCONFIG_NO_REGULAR_EXPRESSIONS jpayne@69: # define UCONFIG_NO_REGULAR_EXPRESSIONS 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_NO_SERVICE jpayne@69: * This switch turns off service registration. jpayne@69: * jpayne@69: * @stable ICU 3.2 jpayne@69: */ jpayne@69: #ifndef UCONFIG_NO_SERVICE jpayne@69: # define UCONFIG_NO_SERVICE 0 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_HAVE_PARSEALLINPUT jpayne@69: * This switch turns on the "parse all input" attribute. Binary incompatible. jpayne@69: * jpayne@69: * @internal jpayne@69: */ jpayne@69: #ifndef UCONFIG_HAVE_PARSEALLINPUT jpayne@69: # define UCONFIG_HAVE_PARSEALLINPUT 1 jpayne@69: #endif jpayne@69: jpayne@69: /** jpayne@69: * \def UCONFIG_NO_FILTERED_BREAK_ITERATION jpayne@69: * This switch turns off filtered break iteration code. jpayne@69: * jpayne@69: * @internal jpayne@69: */ jpayne@69: #ifndef UCONFIG_NO_FILTERED_BREAK_ITERATION jpayne@69: # define UCONFIG_NO_FILTERED_BREAK_ITERATION 0 jpayne@69: #endif jpayne@69: jpayne@69: #endif // __UCONFIG_H__