summaryrefslogtreecommitdiffhomepage
path: root/loader
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-11 15:24:15 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-11 15:24:15 +0100
commitf34939600a96d75047bcd96cd0cda38884f43e82 (patch)
treec2660bb068d17b6e69a8ba329d9541d4958ada3c /loader
parent183f7b1dc55c9af6159dae45f5cd33078562b71e (diff)
actually always set console output codepage
Diffstat (limited to 'loader')
-rw-r--r--loader/init.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/loader/init.cpp b/loader/init.cpp
index d6a447e0..b4733ca7 100644
--- a/loader/init.cpp
+++ b/loader/init.cpp
@@ -1,11 +1,16 @@
#include "impl.hpp"
+
#ifdef _WIN32
#include <windows.h>
-extern "C" __declspec(dllimport) long WINAPI RtlGetVersion (PRTL_OSVERSIONINFOEXW);
+#if __has_include(<ntddk.h>)
+#include <ntddk.h>
+#else
+extern "C" __declspec(dllimport) long WINAPI RtlGetVersion(PRTL_OSVERSIONINFOEXW);
+#endif
#ifdef _MSC_VER
#pragma comment(lib, "ntdll.lib")
#endif
-#endif
+#endif // _WIN32
namespace floormat::loader_detail {
@@ -24,11 +29,9 @@ static bool check_windows_build_number(unsigned major, unsigned minor, unsigned
static void system_init_()
{
#ifdef _WIN32
+ (void)::SetConsoleOutputCP(CP_UTF8);
if (check_windows_build_number(10, 0, 17035))
- {
- (void)::SetConsoleOutputCP(CP_UTF8);
(void)::SetConsoleCP(CP_UTF8);
- }
#endif
}