[C] Enabled wchar_t and utf-8 by default

This commit is contained in:
seleznevae
2019-08-29 09:12:58 +03:00
parent 5bfabee696
commit 64dbd4c2c4
9 changed files with 79 additions and 24 deletions

View File

@@ -1,4 +1,5 @@
option(FORT_HAVE_WCHAR "Enable wchar support" ON)
option(FORT_HAVE_UTF8 "Enable UTF8 support" ON)
add_library(fort
fort.c)
@@ -12,10 +13,17 @@ set_target_properties(fort
PROPERTIES VERSION ${libfort_VERSION}
SOVERSION ${libfort_SOVERSION})
if(FORT_HAVE_WCHAR)
if(NOT FORT_HAVE_WCHAR)
target_compile_definitions(fort
PRIVATE
-DFT_CONGIG_HAVE_WCHAR
-DFT_CONGIG_DISABLE_WCHAR
)
endif()
if(NOT FORT_HAVE_UTF8)
target_compile_definitions(fort
PRIVATE
-DFT_CONGIG_DISABLE_UTF8
)
endif()

View File

@@ -53,21 +53,37 @@ SOFTWARE.
/*****************************************************************************
* Configuration
*****************************************************************************/
///**
// * libfort configuration macros
// * (to enable/disable some options this macros should be defined/undefined)
// */
///** #define FT_CONGIG_HAVE_WCHAR */
//#if defined(FT_CONGIG_HAVE_WCHAR)
//#define FT_HAVE_WCHAR
//#endif
//#define FT_CONGIG_HAVE_UTF8
//#if defined(FT_CONGIG_HAVE_UTF8)
//#define FT_HAVE_UTF8
//#endif
/**
* libfort configuration macros
* (to enable/disable some options this macros should be defined/undefined)
* (to disable wchar_t/utf-8 support this macros should be defined)
*/
/** #define FT_CONGIG_HAVE_WCHAR */
/** #define FT_CONGIG_DISABLE_WCHAR */
/** #define FT_CONGIG_DISABLE_UTF8 */
#if defined(FT_CONGIG_HAVE_WCHAR)
#if !defined(FT_CONGIG_DISABLE_WCHAR)
#define FT_HAVE_WCHAR
#endif
#define FT_CONGIG_HAVE_UTF8
#if defined(FT_CONGIG_HAVE_UTF8)
#if !defined(FT_CONGIG_DISABLE_UTF8)
#define FT_HAVE_UTF8
#endif
/*****************************************************************************
* RETURN CODES
*****************************************************************************/