From 0bdb20fd8e8614f74bd5bd8585ec3685ee8511be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lasse=20=C3=96=C3=B6rni?= Date: Tue, 27 Jun 2017 20:04:49 +0300 Subject: [PATCH] Add MINI_URHO check to disable Windows OS version detection, to help with issue #1998. --- Source/Urho3D/Core/ProcessUtils.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Urho3D/Core/ProcessUtils.cpp b/Source/Urho3D/Core/ProcessUtils.cpp index 388c252e0f..7b4ed55bc8 100644 --- a/Source/Urho3D/Core/ProcessUtils.cpp +++ b/Source/Urho3D/Core/ProcessUtils.cpp @@ -583,7 +583,8 @@ String GetHostName() return String::EMPTY; } -#if defined(_WIN32) +// Disable Windows OS version functionality when compiling mini version for Web, see https://github.com/urho3d/Urho3D/issues/1998 +#if defined(_WIN32) && !defined(MINI_URHO) typedef NTSTATUS (WINAPI *RtlGetVersionPtr)(PRTL_OSVERSIONINFOW); static void GetOS(RTL_OSVERSIONINFOW *r) @@ -604,7 +605,7 @@ String GetOSVersion() struct utsname u; if (uname(&u) == 0) return String(u.sysname) + " " + u.release; -#elif defined(_WIN32) +#elif defined(_WIN32) && !defined(MINI_URHO) RTL_OSVERSIONINFOW r; GetOS(&r); // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx