From: Ivan Maidanski Date: Wed, 17 Aug 2016 08:15:08 +0000 (+0300) Subject: Fix 'GetVersion deprecated' compiler warning in os_dep (MS VC) X-Git-Tag: v8.0.0~1170 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6af3f60ef669eb70f5b7d0529a6eeb0ec6ffac66;p=gc Fix 'GetVersion deprecated' compiler warning in os_dep (MS VC) * os_dep.c [MSWIN32] (GC_init_win32): Do not call GetVersion if VS 2013+ or Win64 target (set GC_wnt to true instead). --- diff --git a/os_dep.c b/os_dep.c index 41ca5fbf..c948c886 100644 --- a/os_dep.c +++ b/os_dep.c @@ -1635,11 +1635,18 @@ void GC_register_data_segments(void) GC_INNER void GC_init_win32(void) { - /* Set GC_wnt. If we're running under win32s, assume that no DLLs */ - /* will be loaded. I doubt anyone still runs win32s, but... */ - DWORD v = GetVersion(); - GC_wnt = !(v & 0x80000000); - GC_no_win32_dlls |= ((!GC_wnt) && (v & 0xff) <= 3); +# if defined(_WIN64) || (defined(_MSC_VER) && _MSC_VER >= 1800) + /* MS Visual Studio 2013 deprecates GetVersion, but on the other */ + /* hand it cannot be used to target pre-Win2K. */ + GC_wnt = TRUE; +# else + /* Set GC_wnt. If we're running under win32s, assume that no */ + /* DLLs will be loaded. I doubt anyone still runs win32s, but... */ + DWORD v = GetVersion(); + + GC_wnt = !(v & 0x80000000); + GC_no_win32_dlls |= ((!GC_wnt) && (v & 0xff) <= 3); +# endif # ifdef USE_MUNMAP if (GC_no_win32_dlls) { /* Turn off unmapping for safety (since may not work well with */