From 821a592f0237add4056d2e848c7634854685db1a Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Wed, 23 Jul 2025 10:18:01 +0800 Subject: [PATCH] feat: add various detector. - add endian and compiler detector, and modify os detector. - now we use CMake to add detector-used macro, instead of using some C++ features to detect them. - change Windows environment detection according to the change of os detector. --- doc/src/library_macros.dox | 2 +- doc/src/win_import.dox | 2 +- src/CMakeLists.txt | 14 ++++++++++++++ src/YYCCLegacy/ArgParser.cpp | 4 ++-- src/YYCCLegacy/ArgParser.hpp | 2 +- src/YYCCLegacy/COMHelper.cpp | 2 +- src/YYCCLegacy/COMHelper.hpp | 2 +- src/YYCCLegacy/ConsoleHelper.cpp | 10 +++++----- src/YYCCLegacy/DialogHelper.cpp | 2 +- src/YYCCLegacy/DialogHelper.hpp | 2 +- src/YYCCLegacy/ExceptionHelper.cpp | 2 +- src/YYCCLegacy/ExceptionHelper.hpp | 2 +- src/YYCCLegacy/IOHelper.cpp | 4 ++-- src/YYCCLegacy/WinFctHelper.cpp | 2 +- src/YYCCLegacy/WinFctHelper.hpp | 2 +- src/YYCCLegacy/YYCCInternal.hpp | 2 +- src/yycc/encoding/iconv.cpp | 23 +++++++++++++++++------ src/yycc/encoding/iconv.hpp | 2 +- src/yycc/encoding/windows.cpp | 2 +- src/yycc/encoding/windows.hpp | 2 +- src/yycc/macro/compiler_detector.hpp | 5 +++++ src/yycc/macro/endian_detector.hpp | 7 +++++++ src/yycc/macro/os_detector.hpp | 11 +++-------- src/yycc/patch/path.cpp | 4 ++-- src/yycc/prelude/core.hpp | 3 +++ src/yycc/windows/import_guard_head.hpp | 2 +- src/yycc/windows/import_guard_tail.hpp | 2 +- src/yycc/windows/unsafe_suppressor.hpp | 2 +- testbench/main_legacy.cpp | 12 ++++++------ 29 files changed, 84 insertions(+), 49 deletions(-) create mode 100644 src/yycc/macro/compiler_detector.hpp create mode 100644 src/yycc/macro/endian_detector.hpp diff --git a/doc/src/library_macros.dox b/doc/src/library_macros.dox index f490e99..9ca472a 100644 --- a/doc/src/library_macros.dox +++ b/doc/src/library_macros.dox @@ -73,7 +73,7 @@ Assume \c blabla() function is Windows specific. We have following example code: \code -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) blabla(); #endif \endcode diff --git a/doc/src/win_import.dox b/doc/src/win_import.dox index b84ca4d..7269a12 100644 --- a/doc/src/win_import.dox +++ b/doc/src/win_import.dox @@ -11,7 +11,7 @@ Due to legacy reason, Windows defines various things which are not compatible wi YYCC has a way to solve the issue introduced above. \code -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #include #include #include "other_header_depend_on_windows.h" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5fc9898..b168862 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -45,6 +45,8 @@ FILES yycc/macro/version_cmp.hpp yycc/macro/feature_probe.hpp yycc/macro/os_detector.hpp + yycc/macro/endian_detector.hpp + yycc/macro/compiler_detector.hpp yycc/macro/class_copy_move.hpp yycc/string.hpp yycc/string/reinterpret.hpp @@ -124,6 +126,16 @@ PUBLIC $<$:YYCC_DEBUG_UE_FILTER> # Iconv environment macro $<$:YYCC_FEAT_ICONV> + # OS macro + $<$:YYCC_OS_WINDOWS> + $<$:YYCC_OS_LINUX> + # Compiler macro + $<$:YYCC_CC_GCC> + $<$:YYCC_CC_CLANG> + $<$:YYCC_CC_MSVC> + # Endian macro + $<$:YYCC_ENDIAN_LITTLE> + $<$:YYCC_ENDIAN_BIG> PRIVATE # Unicode charset for private using $<$:UNICODE> @@ -135,6 +147,8 @@ PRIVATE $<$:/utf-8> ) +# TODO: Fix GCC stacktrace link issue + # Install binary and headers install(TARGETS YYCCommonplace EXPORT YYCCommonplaceTargets diff --git a/src/YYCCLegacy/ArgParser.cpp b/src/YYCCLegacy/ArgParser.cpp index 04eacf1..bde8f61 100644 --- a/src/YYCCLegacy/ArgParser.cpp +++ b/src/YYCCLegacy/ArgParser.cpp @@ -3,7 +3,7 @@ #include "EncodingHelper.hpp" #include "ConsoleHelper.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #include "WinImportPrefix.hpp" #include #include @@ -24,7 +24,7 @@ namespace YYCC::ArgParser { return ArgumentList(std::move(args)); } -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) ArgumentList ArgumentList::CreateFromWin32() { // Reference: https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-commandlinetoargvw diff --git a/src/YYCCLegacy/ArgParser.hpp b/src/YYCCLegacy/ArgParser.hpp index 075bcd5..7f17ae8 100644 --- a/src/YYCCLegacy/ArgParser.hpp +++ b/src/YYCCLegacy/ArgParser.hpp @@ -37,7 +37,7 @@ namespace YYCC::ArgParser { * and should not be seen as a part of arguments. */ static ArgumentList CreateFromStd(int argc, char* argv[]); -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) /** * @brief Create argument list from Win32 function. * @details diff --git a/src/YYCCLegacy/COMHelper.cpp b/src/YYCCLegacy/COMHelper.cpp index b628a8f..4e01629 100644 --- a/src/YYCCLegacy/COMHelper.cpp +++ b/src/YYCCLegacy/COMHelper.cpp @@ -1,5 +1,5 @@ #include "COMHelper.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) namespace YYCC::COMHelper { diff --git a/src/YYCCLegacy/COMHelper.hpp b/src/YYCCLegacy/COMHelper.hpp index 30420d3..8bb6b33 100644 --- a/src/YYCCLegacy/COMHelper.hpp +++ b/src/YYCCLegacy/COMHelper.hpp @@ -1,6 +1,6 @@ #pragma once #include "YYCCInternal.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #include diff --git a/src/YYCCLegacy/ConsoleHelper.cpp b/src/YYCCLegacy/ConsoleHelper.cpp index f74e194..e6bb634 100644 --- a/src/YYCCLegacy/ConsoleHelper.cpp +++ b/src/YYCCLegacy/ConsoleHelper.cpp @@ -5,7 +5,7 @@ #include // Include Windows used headers in Windows. -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #include "WinImportPrefix.hpp" #include #include @@ -16,7 +16,7 @@ namespace YYCC::ConsoleHelper { #pragma region Windows Specific Functions -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) static bool RawEnableColorfulConsole(FILE* fs) { if (!_isatty(_fileno(fs))) return false; @@ -161,7 +161,7 @@ namespace YYCC::ConsoleHelper { #pragma endregion bool EnableColorfulConsole() { -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) bool ret = true; ret &= RawEnableColorfulConsole(stdout); @@ -177,7 +177,7 @@ namespace YYCC::ConsoleHelper { } yycc_u8string ReadLine() { -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) // get stdin mode HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE); @@ -221,7 +221,7 @@ namespace YYCC::ConsoleHelper { strl += YYCC_U8("\n"); } -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) // call Windows specific writer WinConsoleWrite(strl, bIsErr); #else diff --git a/src/YYCCLegacy/DialogHelper.cpp b/src/YYCCLegacy/DialogHelper.cpp index e8f87a0..6e4e7d1 100644 --- a/src/YYCCLegacy/DialogHelper.cpp +++ b/src/YYCCLegacy/DialogHelper.cpp @@ -1,5 +1,5 @@ #include "DialogHelper.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #include "EncodingHelper.hpp" #include "StringHelper.hpp" diff --git a/src/YYCCLegacy/DialogHelper.hpp b/src/YYCCLegacy/DialogHelper.hpp index 66c0749..01af5c8 100644 --- a/src/YYCCLegacy/DialogHelper.hpp +++ b/src/YYCCLegacy/DialogHelper.hpp @@ -1,6 +1,6 @@ #pragma once #include "YYCCInternal.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #include "COMHelper.hpp" #include diff --git a/src/YYCCLegacy/ExceptionHelper.cpp b/src/YYCCLegacy/ExceptionHelper.cpp index b43c084..a434a20 100644 --- a/src/YYCCLegacy/ExceptionHelper.cpp +++ b/src/YYCCLegacy/ExceptionHelper.cpp @@ -1,5 +1,5 @@ #include "ExceptionHelper.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #include "WinFctHelper.hpp" #include "ConsoleHelper.hpp" diff --git a/src/YYCCLegacy/ExceptionHelper.hpp b/src/YYCCLegacy/ExceptionHelper.hpp index 23b871b..d31fd6f 100644 --- a/src/YYCCLegacy/ExceptionHelper.hpp +++ b/src/YYCCLegacy/ExceptionHelper.hpp @@ -1,6 +1,6 @@ #pragma once #include "YYCCInternal.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) /** * @brief Windows specific unhandled exception processor. diff --git a/src/YYCCLegacy/IOHelper.cpp b/src/YYCCLegacy/IOHelper.cpp index 008645e..dd637dd 100644 --- a/src/YYCCLegacy/IOHelper.cpp +++ b/src/YYCCLegacy/IOHelper.cpp @@ -7,7 +7,7 @@ #include #include -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #include "WinImportPrefix.hpp" #include #include "WinImportSuffix.hpp" @@ -16,7 +16,7 @@ namespace YYCC::IOHelper { std::FILE* UTF8FOpen(const yycc_char8_t* u8_filepath, const yycc_char8_t* u8_mode) { -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) // convert mode and file path to wchar std::wstring wmode, wpath; diff --git a/src/YYCCLegacy/WinFctHelper.cpp b/src/YYCCLegacy/WinFctHelper.cpp index 5d3ebf9..f841fb5 100644 --- a/src/YYCCLegacy/WinFctHelper.cpp +++ b/src/YYCCLegacy/WinFctHelper.cpp @@ -1,5 +1,5 @@ #include "WinFctHelper.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #include "EncodingHelper.hpp" #include "COMHelper.hpp" diff --git a/src/YYCCLegacy/WinFctHelper.hpp b/src/YYCCLegacy/WinFctHelper.hpp index 3cbc521..6b38d15 100644 --- a/src/YYCCLegacy/WinFctHelper.hpp +++ b/src/YYCCLegacy/WinFctHelper.hpp @@ -1,6 +1,6 @@ #pragma once #include "YYCCInternal.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #include diff --git a/src/YYCCLegacy/YYCCInternal.hpp b/src/YYCCLegacy/YYCCInternal.hpp index ba851da..cc62970 100644 --- a/src/YYCCLegacy/YYCCInternal.hpp +++ b/src/YYCCLegacy/YYCCInternal.hpp @@ -50,7 +50,7 @@ // If we are in Windows, // we need add 2 macros to disable Windows shitty warnings and errors of // depracted functions and not secure functions. -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #if !defined(_CRT_SECURE_NO_WARNINGS) #define _CRT_SECURE_NO_WARNINGS diff --git a/src/yycc/encoding/iconv.cpp b/src/yycc/encoding/iconv.cpp index 7fa2ebe..9ce8d04 100644 --- a/src/yycc/encoding/iconv.cpp +++ b/src/yycc/encoding/iconv.cpp @@ -1,8 +1,9 @@ #include "iconv.hpp" -#if YYCC_FEAT_ICONV || (YYCC_OS != YYCC_OS_WINDOWS) +#if YYCC_FEAT_ICONV || !defined(YYCC_OS_WINDOWS) #include "../string/reinterpret.hpp" +#include "../macro/endian_detector.hpp" #include #include #include @@ -190,20 +191,30 @@ namespace yycc::encoding::iconv { // That's not what we expected. // So we need manually check runtime endian and explicitly specify endian in code name. - // TODO: fix this encoding endian issue. - static const NS_YYCC_STRING::u8char* UTF8_CODENAME_LITERAL = YYCC_U8("UTF-8"); static const NS_YYCC_STRING::u8char* WCHAR_CODENAME_LITERAL = YYCC_U8("WCHAR_T"); static const NS_YYCC_STRING::u8char* fetch_utf16_codename() { - return YYCC_U8("UTF16"); +#if defined(YYCC_ENDIAN_LITTLE) + return YYCC_U8("UTF16LE"); +#else + return YYCC_U8("UTF16BE"); +#endif } static const NS_YYCC_STRING::u8char* UTF16_CODENAME_LITERAL = fetch_utf16_codename(); static const NS_YYCC_STRING::u8char* fetch_utf32_codename() { - return YYCC_U8("UTF32"); +#if defined(YYCC_ENDIAN_LITTLE) + return YYCC_U8("UTF32LE"); +#else + return YYCC_U8("UTF32BE"); +#endif } static const NS_YYCC_STRING::u8char* UTF32_CODENAME_LITERAL = fetch_utf32_codename(); - // TODO: There is a memory copy in this function. Consider removing it in future. + // TODO: + // There is a memory copy in this function. Consider optimizing it in future. + // A possible solution is that create a std::vector-like wrapper for std::basic_string and std::basic_string_view. + // We call them VecString and VecStringView, and use them in "iconv_kernel" instead of real std::vector. + // They exposed interface are std::vector-like but its inner is std::basic_string and std::basic_string_view. #define CONVFN_TYPE0(src_char_type, dst_char_type) \ namespace expected = NS_YYCC_PATCH_EXPECTED; \ auto rv = iconv_kernel(this->token, reinterpret_cast(src.data()), src.size()); \ diff --git a/src/yycc/encoding/iconv.hpp b/src/yycc/encoding/iconv.hpp index 9b1c778..9f486dc 100644 --- a/src/yycc/encoding/iconv.hpp +++ b/src/yycc/encoding/iconv.hpp @@ -1,7 +1,7 @@ #pragma once #include "../macro/os_detector.hpp" -#if YYCC_FEAT_ICONV || (YYCC_OS != YYCC_OS_WINDOWS) +#if YYCC_FEAT_ICONV || !defined(YYCC_OS_WINDOWS) #include "../macro/class_copy_move.hpp" #include "../patch/expected.hpp" diff --git a/src/yycc/encoding/windows.cpp b/src/yycc/encoding/windows.cpp index c100ba0..346b2ea 100644 --- a/src/yycc/encoding/windows.cpp +++ b/src/yycc/encoding/windows.cpp @@ -1,6 +1,6 @@ #include "windows.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #include "../string/reinterpret.hpp" #include diff --git a/src/yycc/encoding/windows.hpp b/src/yycc/encoding/windows.hpp index 08f7f3c..4e81d79 100644 --- a/src/yycc/encoding/windows.hpp +++ b/src/yycc/encoding/windows.hpp @@ -1,7 +1,7 @@ #pragma once #include "../macro/os_detector.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #include "../patch/expected.hpp" #include "../string.hpp" diff --git a/src/yycc/macro/compiler_detector.hpp b/src/yycc/macro/compiler_detector.hpp new file mode 100644 index 0000000..afff48f --- /dev/null +++ b/src/yycc/macro/compiler_detector.hpp @@ -0,0 +1,5 @@ +#pragma once + +#if (defined(YYCC_CC_MSVC) + defined(YYCC_CC_GCC) + defined(YYCC_CC_CLANG)) != 1 +#error "Current compiler is not supported!" +#endif diff --git a/src/yycc/macro/endian_detector.hpp b/src/yycc/macro/endian_detector.hpp new file mode 100644 index 0000000..87efbbf --- /dev/null +++ b/src/yycc/macro/endian_detector.hpp @@ -0,0 +1,7 @@ +#pragma once + +// Check endian +#if (defined(YYCC_ENDIAN_LITTLE) + defined(YYCC_ENDIAN_BIG)) != 1 +#error "Current system endian (byte order) is not supported!" +#endif + diff --git a/src/yycc/macro/os_detector.hpp b/src/yycc/macro/os_detector.hpp index 9d8e270..8f58633 100644 --- a/src/yycc/macro/os_detector.hpp +++ b/src/yycc/macro/os_detector.hpp @@ -1,11 +1,6 @@ #pragma once -// Define operating system macros -#define YYCC_OS_WINDOWS 2 -#define YYCC_OS_LINUX 3 -// Check current operating system. -#if defined(_WIN32) -#define YYCC_OS YYCC_OS_WINDOWS -#else -#define YYCC_OS YYCC_OS_LINUX +// Check OS macro +#if (defined(YYCC_OS_WINDOWS) + defined(YYCC_OS_LINUX)) != 1 +#error "Current operating system is not supported!" #endif diff --git a/src/yycc/patch/path.cpp b/src/yycc/patch/path.cpp index 1359c75..883b054 100644 --- a/src/yycc/patch/path.cpp +++ b/src/yycc/patch/path.cpp @@ -12,7 +12,7 @@ namespace yycc::patch::path { // So we need add feature test macro at the same time. std::filesystem::path to_std_path(const NS_YYCC_STRING::u8string_view& u8_path) { -// #if YYCC_OS == YYCC_OS_WINDOWS +// #if defined(YYCC_OS_WINDOWS) // // convert path to wchar // std::wstring wpath; @@ -29,7 +29,7 @@ namespace yycc::patch::path { } NS_YYCC_STRING::u8string to_u8string(const std::filesystem::path& path) { -// #if YYCC_OS == YYCC_OS_WINDOWS +// #if defined(YYCC_OS_WINDOWS) // // get and convert to utf8 // NS_YYCC_STRING::u8string u8_path; diff --git a/src/yycc/prelude/core.hpp b/src/yycc/prelude/core.hpp index 9e3f39b..83ed97c 100644 --- a/src/yycc/prelude/core.hpp +++ b/src/yycc/prelude/core.hpp @@ -1,5 +1,8 @@ #pragma once +// Suppress unsafe warning on Windows +#include "../windows/unsafe_suppressor.hpp" + // Prelude section #include "../string.hpp" namespace yycc::prelude { diff --git a/src/yycc/windows/import_guard_head.hpp b/src/yycc/windows/import_guard_head.hpp index d6a331a..7ce6f0a 100644 --- a/src/yycc/windows/import_guard_head.hpp +++ b/src/yycc/windows/import_guard_head.hpp @@ -4,7 +4,7 @@ #include "../macro/os_detector.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) // Define 2 macros to disallow Windows generate MIN and MAX macros // which cause std::min and std::max can not function as normal. diff --git a/src/yycc/windows/import_guard_tail.hpp b/src/yycc/windows/import_guard_tail.hpp index 4b1e71f..af28574 100644 --- a/src/yycc/windows/import_guard_tail.hpp +++ b/src/yycc/windows/import_guard_tail.hpp @@ -4,7 +4,7 @@ #include "../macro/os_detector.hpp" -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) // Windows also will generate following macros // which may cause the function sign is different in Windows and other platforms. diff --git a/src/yycc/windows/unsafe_suppressor.hpp b/src/yycc/windows/unsafe_suppressor.hpp index 7e88447..b177bdb 100644 --- a/src/yycc/windows/unsafe_suppressor.hpp +++ b/src/yycc/windows/unsafe_suppressor.hpp @@ -4,7 +4,7 @@ // If we are in Windows, // we need add 2 macros to disable Windows shitty warnings and errors of // depracted functions and not secure functions. -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) #if !defined(_CRT_SECURE_NO_WARNINGS) #define _CRT_SECURE_NO_WARNINGS diff --git a/testbench/main_legacy.cpp b/testbench/main_legacy.cpp index 19fe7de..49a32a2 100644 --- a/testbench/main_legacy.cpp +++ b/testbench/main_legacy.cpp @@ -167,7 +167,7 @@ namespace YYCCTestbench { } // check wstring convertion on windows -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) for (size_t i = 0u; i < count; ++i) { // get item const auto& u8str = c_UTF8TestStrTable[i]; @@ -306,7 +306,7 @@ namespace YYCCTestbench { } static void DialogTestbench() { -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) YYCC::yycc_u8string ret; std::vector rets; @@ -340,7 +340,7 @@ namespace YYCCTestbench { } static void ExceptionTestbench() { -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) YYCC::ExceptionHelper::Register([](const YYCC::yycc_u8string& log_path, const YYCC::yycc_u8string& coredump_path) -> void { MessageBoxW( @@ -374,7 +374,7 @@ namespace YYCCTestbench { } static void WinFctTestbench() { -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) HMODULE test_current_module; Assert((test_current_module = YYCC::WinFctHelper::GetCurrentModule()) != nullptr, YYCC_U8("YYCC::WinFctHelper::GetCurrentModule")); @@ -412,7 +412,7 @@ namespace YYCCTestbench { } YYCC::yycc_u8string test_slashed_path(YYCC::StdPatch::ToUTF8Path(test_path)); -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) std::wstring wdelimiter(1u, std::filesystem::path::preferred_separator); YYCC::yycc_u8string delimiter(YYCC::EncodingHelper::WcharToUTF8(wdelimiter)); #else @@ -622,7 +622,7 @@ namespace YYCCTestbench { YYCC::ConsoleHelper::FormatLine(YYCC_U8("\t%s"), result.Argument().c_str()); } } -#if YYCC_OS == YYCC_OS_WINDOWS +#if defined(YYCC_OS_WINDOWS) { YYCC::ConsoleHelper::WriteLine(YYCC_U8("YYCC::ArgParser::ArgumentList::CreateFromWin32")); auto result = YYCC::ArgParser::ArgumentList::CreateFromWin32();