diff --git a/src/common/atomic.h b/src/common/atomic.h index 73852c9639..716917f9ef 100644 --- a/src/common/atomic.h +++ b/src/common/atomic.h @@ -19,8 +19,8 @@ #if defined(_MSC_VER) #include "winapi.h" -// This checks if C/C++ Compiler Version is 18.00 -#if _MSC_VER < 1800 +// This checks if C/C++ Compiler Version is 18.00 or Windows is older than Vista +#if _MSC_VER < 1800 || WINVER < _WIN32_WINNT_VISTA #if !defined(_M_X64) // When compiling for windows 32bit, the 8byte interlocked operations are not provided by microsoft diff --git a/src/common/winapi.h b/src/common/winapi.h index 7ce5550492..88015929cc 100644 --- a/src/common/winapi.h +++ b/src/common/winapi.h @@ -1,11 +1,24 @@ #pragma once +#include + +#ifndef NTDDI_VERSION + #define NTDDI_VERSION 0x05000000 // Windows 2000 +#endif +#ifndef _WIN32_WINNT + #define _WIN32_WINNT 0x0500 // Windows 2000 +#endif +#ifndef WINVER + #define WINVER 0x0500 // Windows 2000 +#endif +#ifndef _WIN32_IE + #define _WIN32_IE 0x0600 // Internet Explorer 6.0 +#endif +#ifndef _WIN32_WINNT_VISTA + #define _WIN32_WINNT_VISTA 0x0600 // Windows Vista +#endif #define STRICT -#define NTDDI_VERSION NTDDI_WIN2K -#define _WIN32_WINNT 0x0500 -#define WINVER 0x0500 -#define _WIN32_IE 0x0600 #define WIN32_LEAN_AND_MEAN #define NOCOMM #define NOKANJI