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