From 39c1cc3d04409802dca5d20c631534ad46db1563 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Fri, 3 Jan 2025 05:31:19 -0800 Subject: [PATCH 1/7] Don't strictly require inih inih isn't used by anything in liblcf directly, relaxing this requirement and allowing it to be disabled enables outside projects to more easily integrate this library into their application. This PR enables this while still making it the default, so the current behavior is the default one requiring no changes in existing apps (easyrpg-player) --- CMakeLists.txt | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87f8feec..a084454b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ include(MiscUtils) # Compilation options option(BUILD_SHARED_LIBS "Build shared library, disable for building the static library (default: ON)" ON) +option(LIBLCF_WITH_INIH "INI parsing support, (inih, default: ON)" ON) option(LIBLCF_WITH_ICU "ICU encoding handling (when disabled only windows-1252 is supported, default: ON)" ON) option(LIBLCF_WITH_XML "XML reading support (expat, default: ON)" ON) option(LIBLCF_UPDATE_MIMEDB "Whether to run update-mime-database after install (default: ON)" ON) @@ -30,7 +31,6 @@ set(LCF_SOURCES src/dbarray.cpp src/dbstring_struct.cpp src/encoder.cpp - src/inireader.cpp src/ldb_equipment.cpp src/ldb_eventcommand.cpp src/ldb_parameters.cpp @@ -202,7 +202,6 @@ set(LCF_HEADERS src/lcf/encoder.h src/lcf/enum_tags.h src/lcf/flag_set.h - src/lcf/inireader.h src/lcf/ldb/reader.h src/lcf/lmt/reader.h src/lcf/lmu/reader.h @@ -294,6 +293,19 @@ set(LCF_HEADERS src/lcf/third_party/string_view.h ) + + +set(LCF_SUPPORT_INIH 0) +if(LIBLCF_WITH_INIH) + list(APPEND LCF_SOURCES + src/inireader.cpp + ) + list(APPEND LCF_HEADERS + src/lcf/inireader.h + ) + set(LCF_SUPPORT_INIH 1) +endif() + add_library(lcf ${LCF_SOURCES} ${LCF_HEADERS}) # IDE source grouping @@ -344,8 +356,10 @@ set_property(TARGET lcf PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) set_property(TARGET lcf PROPERTY EXPORT_NAME liblcf) # inih -find_package(inih REQUIRED) -target_link_libraries(lcf inih::inih) +if (LCF_SUPPORT_INIH) + find_package(inih REQUIRED) + target_link_libraries(lcf inih::inih) +endif () # icu set(LCF_SUPPORT_ICU 0) From 8c4f207d0c9e2df447c945f2b436b112c4c7a723 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Mon, 6 Jan 2025 10:52:36 +0100 Subject: [PATCH 2/7] Document that EasyRPG Player requires inih Exclude inih from CMake config file when disabled. --- CMakeLists.txt | 6 +++--- README.md | 4 ++-- builds/cmake/liblcf-config.cmake.in | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a084454b..6fa518a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ include(MiscUtils) # Compilation options option(BUILD_SHARED_LIBS "Build shared library, disable for building the static library (default: ON)" ON) -option(LIBLCF_WITH_INIH "INI parsing support, (inih, default: ON)" ON) +option(LIBLCF_WITH_INIH "INI parsing support (inih, required when building EasyRPG Player, default: ON)" ON) option(LIBLCF_WITH_ICU "ICU encoding handling (when disabled only windows-1252 is supported, default: ON)" ON) option(LIBLCF_WITH_XML "XML reading support (expat, default: ON)" ON) option(LIBLCF_UPDATE_MIMEDB "Whether to run update-mime-database after install (default: ON)" ON) @@ -293,8 +293,6 @@ set(LCF_HEADERS src/lcf/third_party/string_view.h ) - - set(LCF_SUPPORT_INIH 0) if(LIBLCF_WITH_INIH) list(APPEND LCF_SOURCES @@ -359,6 +357,8 @@ set_property(TARGET lcf PROPERTY EXPORT_NAME liblcf) if (LCF_SUPPORT_INIH) find_package(inih REQUIRED) target_link_libraries(lcf inih::inih) +else() + message(STATUS "inih is disabled. This component is required when building EasyRPG Player.") endif () # icu diff --git a/README.md b/README.md index bc035968..5cba66b7 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ Documentation is available at the documentation wiki: https://wiki.easyrpg.org ## Requirements -- [inih] for INI file reading. (required) +- [inih] for INI file reading. (required when building EasyRPG Player) - [Expat] for XML reading support. -- [ICU] for character encoding detection and conversion (recommended). +- [ICU] for character encoding detection and conversion (recommended). When disabled only Windows-1252 is supported. ## Source code diff --git a/builds/cmake/liblcf-config.cmake.in b/builds/cmake/liblcf-config.cmake.in index 729f0173..5c39d979 100644 --- a/builds/cmake/liblcf-config.cmake.in +++ b/builds/cmake/liblcf-config.cmake.in @@ -5,7 +5,9 @@ include(CMakeFindDependencyMacro) # Required to find our installed Findinih.cmake list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") -find_dependency(inih REQUIRED) +if(@LCF_SUPPORT_INIH@) + find_dependency(inih REQUIRED) +endif() if(@LCF_SUPPORT_ICU@ EQUAL 1) find_dependency(ICU COMPONENTS i18n uc data REQUIRED) From 6964f71f5be1ced99dc6bd456263a7680712a250 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 7 Jan 2025 14:55:17 -0800 Subject: [PATCH 3/7] Properly guard INIH calls --- builds/config.h.in | 3 +++ src/lcf/reader_util.h | 4 ++-- src/reader_util.cpp | 2 ++ tools/lcf2xml.cpp | 5 +++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/builds/config.h.in b/builds/config.h.in index d3cedbb6..aeaeb28b 100644 --- a/builds/config.h.in +++ b/builds/config.h.in @@ -5,3 +5,6 @@ /* Enable XML reading support (expat) */ #define LCF_SUPPORT_XML @LCF_SUPPORT_XML@ + +/* Enable INI reading support (INIH ) */ +#define LCF_SUPPORT_INIH @LCF_SUPPORT_INIH@ \ No newline at end of file diff --git a/src/lcf/reader_util.h b/src/lcf/reader_util.h index ed3413fb..7710b408 100644 --- a/src/lcf/reader_util.h +++ b/src/lcf/reader_util.h @@ -68,7 +68,7 @@ namespace ReaderUtil { * @return list of encodings or empty if not detected */ std::vector DetectEncodings(StringView string); - +#if LCF_SUPPORT_INIH /** * Returns the encoding set in the ini file. * @@ -86,7 +86,7 @@ namespace ReaderUtil { * @return encoding or empty string if not found. */ std::string GetEncoding(std::istream& filestream); - +#endif /** * Returns the system encoding based on current locale settings. * diff --git a/src/reader_util.cpp b/src/reader_util.cpp index a1ce23d0..2f29fa04 100644 --- a/src/reader_util.cpp +++ b/src/reader_util.cpp @@ -206,6 +206,7 @@ std::vector ReaderUtil::DetectEncodings(StringView string) { return encodings; } +#if LCF_SUPPORT_INIH std::string ReaderUtil::GetEncoding(StringView ini_file) { INIReader ini(ToString(ini_file)); if (ini.ParseError() != -1) { @@ -227,6 +228,7 @@ std::string ReaderUtil::GetEncoding(std::istream& filestream) { } return {}; } +#endif std::string ReaderUtil::GetLocaleEncoding() { #ifdef _WIN32 diff --git a/tools/lcf2xml.cpp b/tools/lcf2xml.cpp index af798de2..bfdf3e05 100644 --- a/tools/lcf2xml.cpp +++ b/tools/lcf2xml.cpp @@ -250,7 +250,7 @@ void PrintReaderError(const std::string data) int ReaderWriteToFile(const std::string& in, const std::string& out, FileTypes in_type, lcf::EngineVersion engine, std::string encoding) { std::string path = GetPath(in) + "/"; - +#if LCF_SUPPORT_INIH if (encoding.empty()) { #ifdef _WIN32 encoding = lcf::ReaderUtil::GetEncoding(path + "RPG_RT.ini"); @@ -276,7 +276,8 @@ int ReaderWriteToFile(const std::string& in, const std::string& out, FileTypes i } #endif } - +#endif + if (encoding.empty()) { encoding = lcf::ReaderUtil::GetLocaleEncoding(); } From 90ac4e8ada59ad5ece26dc49145a569fa66ea5da Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 7 Jan 2025 15:06:57 -0800 Subject: [PATCH 4/7] Use matching naming scheme, add ini to configure.ac --- CMakeLists.txt | 10 +++++----- builds/cmake/liblcf-config.cmake.in | 2 +- builds/config.h.in | 2 +- configure.ac | 7 +++++++ src/lcf/reader_util.h | 2 +- src/reader_util.cpp | 2 +- tools/lcf2xml.cpp | 2 +- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fa518a7..7ec059bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ include(MiscUtils) # Compilation options option(BUILD_SHARED_LIBS "Build shared library, disable for building the static library (default: ON)" ON) -option(LIBLCF_WITH_INIH "INI parsing support (inih, required when building EasyRPG Player, default: ON)" ON) +option(LIBLCF_WITH_INI "INI parsing support (inih, required when building EasyRPG Player, default: ON)" ON) option(LIBLCF_WITH_ICU "ICU encoding handling (when disabled only windows-1252 is supported, default: ON)" ON) option(LIBLCF_WITH_XML "XML reading support (expat, default: ON)" ON) option(LIBLCF_UPDATE_MIMEDB "Whether to run update-mime-database after install (default: ON)" ON) @@ -293,15 +293,15 @@ set(LCF_HEADERS src/lcf/third_party/string_view.h ) -set(LCF_SUPPORT_INIH 0) -if(LIBLCF_WITH_INIH) +set(LCF_SUPPORT_INI 0) +if(LIBLCF_WITH_INI) list(APPEND LCF_SOURCES src/inireader.cpp ) list(APPEND LCF_HEADERS src/lcf/inireader.h ) - set(LCF_SUPPORT_INIH 1) + set(LCF_SUPPORT_INI 1) endif() add_library(lcf ${LCF_SOURCES} ${LCF_HEADERS}) @@ -354,7 +354,7 @@ set_property(TARGET lcf PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON) set_property(TARGET lcf PROPERTY EXPORT_NAME liblcf) # inih -if (LCF_SUPPORT_INIH) +if (LCF_SUPPORT_INI) find_package(inih REQUIRED) target_link_libraries(lcf inih::inih) else() diff --git a/builds/cmake/liblcf-config.cmake.in b/builds/cmake/liblcf-config.cmake.in index 5c39d979..00c55759 100644 --- a/builds/cmake/liblcf-config.cmake.in +++ b/builds/cmake/liblcf-config.cmake.in @@ -5,7 +5,7 @@ include(CMakeFindDependencyMacro) # Required to find our installed Findinih.cmake list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") -if(@LCF_SUPPORT_INIH@) +if(@LCF_SUPPORT_INI@) find_dependency(inih REQUIRED) endif() diff --git a/builds/config.h.in b/builds/config.h.in index aeaeb28b..10d15b98 100644 --- a/builds/config.h.in +++ b/builds/config.h.in @@ -7,4 +7,4 @@ #define LCF_SUPPORT_XML @LCF_SUPPORT_XML@ /* Enable INI reading support (INIH ) */ -#define LCF_SUPPORT_INIH @LCF_SUPPORT_INIH@ \ No newline at end of file +#define LCF_SUPPORT_INI @LCF_SUPPORT_INI@ \ No newline at end of file diff --git a/configure.ac b/configure.ac index ed25ed4b..a48e65e1 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,13 @@ AS_IF([test "x$enable_xml" != "xno"],[ ]) AM_CONDITIONAL(SUPPORT_XML,[test $LCF_SUPPORT_XML == 1]) +AC_SUBST([LCF_SUPPORT_INI],[0]) +AC_ARG_ENABLE([ini],[AS_HELP_STRING([--disable-ini],[Disable INI reading support (inih) [default=no]])]) +AS_IF([test "x$enable_ini" != "xno"],[ + AX_PKG_CHECK_MODULES([EXPAT],[],[ini >= 2.1],[LCF_SUPPORT_INI=1]) +]) +AM_CONDITIONAL(SUPPORT_INI,[test $LCF_SUPPORT_INI == 1]) + # Tools AC_ARG_ENABLE([tools],[AS_HELP_STRING([--disable-tools],[Do not build and install the tools [default=no]])]) AM_CONDITIONAL(ENABLE_TOOLS,[test "x$enable_tools" != "xno"]) diff --git a/src/lcf/reader_util.h b/src/lcf/reader_util.h index 7710b408..47f69272 100644 --- a/src/lcf/reader_util.h +++ b/src/lcf/reader_util.h @@ -68,7 +68,7 @@ namespace ReaderUtil { * @return list of encodings or empty if not detected */ std::vector DetectEncodings(StringView string); -#if LCF_SUPPORT_INIH +#if LCF_SUPPORT_INI /** * Returns the encoding set in the ini file. * diff --git a/src/reader_util.cpp b/src/reader_util.cpp index 2f29fa04..14020704 100644 --- a/src/reader_util.cpp +++ b/src/reader_util.cpp @@ -206,7 +206,7 @@ std::vector ReaderUtil::DetectEncodings(StringView string) { return encodings; } -#if LCF_SUPPORT_INIH +#if LCF_SUPPORT_INI std::string ReaderUtil::GetEncoding(StringView ini_file) { INIReader ini(ToString(ini_file)); if (ini.ParseError() != -1) { diff --git a/tools/lcf2xml.cpp b/tools/lcf2xml.cpp index bfdf3e05..e4b254c7 100644 --- a/tools/lcf2xml.cpp +++ b/tools/lcf2xml.cpp @@ -250,7 +250,7 @@ void PrintReaderError(const std::string data) int ReaderWriteToFile(const std::string& in, const std::string& out, FileTypes in_type, lcf::EngineVersion engine, std::string encoding) { std::string path = GetPath(in) + "/"; -#if LCF_SUPPORT_INIH +#if LCF_SUPPORT_INI if (encoding.empty()) { #ifdef _WIN32 encoding = lcf::ReaderUtil::GetEncoding(path + "RPG_RT.ini"); From 8a5bfb281b1579a5d394ba1955c5ded9806fb854 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 7 Jan 2025 15:26:16 -0800 Subject: [PATCH 5/7] Don't guard functions, just return empty strings --- src/lcf/reader_util.h | 4 ++-- src/reader_util.cpp | 6 ++++-- tools/lcf2xml.cpp | 2 -- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lcf/reader_util.h b/src/lcf/reader_util.h index 47f69272..ed3413fb 100644 --- a/src/lcf/reader_util.h +++ b/src/lcf/reader_util.h @@ -68,7 +68,7 @@ namespace ReaderUtil { * @return list of encodings or empty if not detected */ std::vector DetectEncodings(StringView string); -#if LCF_SUPPORT_INI + /** * Returns the encoding set in the ini file. * @@ -86,7 +86,7 @@ namespace ReaderUtil { * @return encoding or empty string if not found. */ std::string GetEncoding(std::istream& filestream); -#endif + /** * Returns the system encoding based on current locale settings. * diff --git a/src/reader_util.cpp b/src/reader_util.cpp index 14020704..4d1b3ed9 100644 --- a/src/reader_util.cpp +++ b/src/reader_util.cpp @@ -206,8 +206,8 @@ std::vector ReaderUtil::DetectEncodings(StringView string) { return encodings; } -#if LCF_SUPPORT_INI std::string ReaderUtil::GetEncoding(StringView ini_file) { +#if LCF_SUPPORT_INI INIReader ini(ToString(ini_file)); if (ini.ParseError() != -1) { std::string encoding = ini.Get("EasyRPG", "Encoding", std::string()); @@ -215,10 +215,12 @@ std::string ReaderUtil::GetEncoding(StringView ini_file) { return ReaderUtil::CodepageToEncoding(atoi(encoding.c_str())); } } +#endif return {}; } std::string ReaderUtil::GetEncoding(std::istream& filestream) { +#if LCF_SUPPORT_INI INIReader ini(filestream); if (ini.ParseError() != -1) { std::string encoding = ini.Get("EasyRPG", "Encoding", std::string()); @@ -226,9 +228,9 @@ std::string ReaderUtil::GetEncoding(std::istream& filestream) { return ReaderUtil::CodepageToEncoding(atoi(encoding.c_str())); } } +#endif return {}; } -#endif std::string ReaderUtil::GetLocaleEncoding() { #ifdef _WIN32 diff --git a/tools/lcf2xml.cpp b/tools/lcf2xml.cpp index e4b254c7..70789dba 100644 --- a/tools/lcf2xml.cpp +++ b/tools/lcf2xml.cpp @@ -250,7 +250,6 @@ void PrintReaderError(const std::string data) int ReaderWriteToFile(const std::string& in, const std::string& out, FileTypes in_type, lcf::EngineVersion engine, std::string encoding) { std::string path = GetPath(in) + "/"; -#if LCF_SUPPORT_INI if (encoding.empty()) { #ifdef _WIN32 encoding = lcf::ReaderUtil::GetEncoding(path + "RPG_RT.ini"); @@ -276,7 +275,6 @@ int ReaderWriteToFile(const std::string& in, const std::string& out, FileTypes i } #endif } -#endif if (encoding.empty()) { encoding = lcf::ReaderUtil::GetLocaleEncoding(); From cff926573bb34851dc804e8e98d8e00ea561719c Mon Sep 17 00:00:00 2001 From: Ghabry Date: Wed, 8 Jan 2025 22:12:54 +0100 Subject: [PATCH 6/7] Autotools: conditionally compile inih --- Makefile.am | 7 +++++-- builds/config.h.in | 4 ++-- configure.ac | 4 +--- tools/lcf2xml.cpp | 5 +++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6d74635c..7f0d4953 100644 --- a/Makefile.am +++ b/Makefile.am @@ -48,7 +48,6 @@ liblcf_la_SOURCES = \ src/dbarray.cpp \ src/dbstring_struct.cpp \ src/encoder.cpp \ - src/inireader.cpp \ src/ldb_equipment.cpp \ src/ldb_eventcommand.cpp \ src/ldb_parameters.cpp \ @@ -219,7 +218,6 @@ lcfinclude_HEADERS = \ src/lcf/encoder.h \ src/lcf/enum_tags.h \ src/lcf/flag_set.h \ - src/lcf/inireader.h \ src/lcf/log_handler.h \ src/lcf/reader_lcf.h \ src/lcf/reader_util.h \ @@ -231,6 +229,11 @@ lcfinclude_HEADERS = \ src/lcf/writer_lcf.h \ src/lcf/writer_xml.h +if SUPPORT_INI +liblcf_la_SOURCES += src/inireader.cpp +lcfinclude_HEADERS += src/lcf/inireader.h +endif + lcfldbinclude_HEADERS = \ src/lcf/ldb/reader.h \ src/generated/lcf/ldb/chunks.h diff --git a/builds/config.h.in b/builds/config.h.in index 10d15b98..b8b6bcb9 100644 --- a/builds/config.h.in +++ b/builds/config.h.in @@ -6,5 +6,5 @@ /* Enable XML reading support (expat) */ #define LCF_SUPPORT_XML @LCF_SUPPORT_XML@ -/* Enable INI reading support (INIH ) */ -#define LCF_SUPPORT_INI @LCF_SUPPORT_INI@ \ No newline at end of file +/* Enable INI reading support (INIH) */ +#define LCF_SUPPORT_INI @LCF_SUPPORT_INI@ diff --git a/configure.ac b/configure.ac index a48e65e1..b5f87cc6 100644 --- a/configure.ac +++ b/configure.ac @@ -21,8 +21,6 @@ LT_INIT([win32-dll]) AM_CONDITIONAL(CROSS_COMPILING,[test "x$cross_compiling" = "xyes"]) # Checks for libraries. -AX_PKG_CHECK_MODULES([INIH],[],[inih],[]) - AC_SUBST([LCF_SUPPORT_ICU],[0]) AC_ARG_ENABLE([icu],[AS_HELP_STRING([--disable-icu],[Disable ICU encoding handling (only windows-1252 supported) [default=no]])]) AS_IF([test "x$enable_icu" != "xno"],[ @@ -39,7 +37,7 @@ AM_CONDITIONAL(SUPPORT_XML,[test $LCF_SUPPORT_XML == 1]) AC_SUBST([LCF_SUPPORT_INI],[0]) AC_ARG_ENABLE([ini],[AS_HELP_STRING([--disable-ini],[Disable INI reading support (inih) [default=no]])]) AS_IF([test "x$enable_ini" != "xno"],[ - AX_PKG_CHECK_MODULES([EXPAT],[],[ini >= 2.1],[LCF_SUPPORT_INI=1]) + AX_PKG_CHECK_MODULES([INIH],[],[inih],[LCF_SUPPORT_INI=1]) ]) AM_CONDITIONAL(SUPPORT_INI,[test $LCF_SUPPORT_INI == 1]) diff --git a/tools/lcf2xml.cpp b/tools/lcf2xml.cpp index 70789dba..e3caf091 100644 --- a/tools/lcf2xml.cpp +++ b/tools/lcf2xml.cpp @@ -60,7 +60,7 @@ int main(int argc, char** argv) std::cerr << "Usage: " << argv[0] << "[--2k] [--2k3] file1 [... fileN]" << std::endl; std::cerr << "\t--2k: Treat files as RPG 2000" << std::endl; std::cerr << "\t--2k3: Treat files as RPG 2003 (default)" << std::endl; - std::cerr << "\t--encoding N: Use encoding N as the file encoding" << std::endl; + std::cerr << "\t--encoding N: Use encoding N as the file encoding" << std::endl; return 1; } @@ -250,6 +250,7 @@ void PrintReaderError(const std::string data) int ReaderWriteToFile(const std::string& in, const std::string& out, FileTypes in_type, lcf::EngineVersion engine, std::string encoding) { std::string path = GetPath(in) + "/"; + if (encoding.empty()) { #ifdef _WIN32 encoding = lcf::ReaderUtil::GetEncoding(path + "RPG_RT.ini"); @@ -275,7 +276,7 @@ int ReaderWriteToFile(const std::string& in, const std::string& out, FileTypes i } #endif } - + if (encoding.empty()) { encoding = lcf::ReaderUtil::GetLocaleEncoding(); } From b7f3735ab0d7258103308f5fcabe54a19a1db425 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 9 Jan 2025 00:17:40 -0800 Subject: [PATCH 7/7] Log warning instead of silently failing if inih is disabled --- src/reader_util.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/reader_util.cpp b/src/reader_util.cpp index 4d1b3ed9..8718d22c 100644 --- a/src/reader_util.cpp +++ b/src/reader_util.cpp @@ -215,6 +215,8 @@ std::string ReaderUtil::GetEncoding(StringView ini_file) { return ReaderUtil::CodepageToEncoding(atoi(encoding.c_str())); } } +#else + Log::Warning("Could not get encoding from ini file, disabled in this liblcf build."); #endif return {}; } @@ -228,6 +230,8 @@ std::string ReaderUtil::GetEncoding(std::istream& filestream) { return ReaderUtil::CodepageToEncoding(atoi(encoding.c_str())); } } +#else + Log::Warning("Could not get encoding from ini file, disabled in this liblcf build."); #endif return {}; }