[C] Enabled wchar_t and utf-8 by default
This commit is contained in:
@@ -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()
|
||||
|
||||
|
26
lib/fort.h
26
lib/fort.h
@@ -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
|
||||
*****************************************************************************/
|
||||
|
Reference in New Issue
Block a user