From 370d44264878b06f3e662fc40a2b75cd03f2b3ad Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Tue, 26 Apr 2011 02:40:44 +0200 Subject: [PATCH] [win] Moved all WINVER defines to common.pri so they affect also 3party libs --- 3party/gflags/src/mutex.h | 2 +- .../src/google/protobuf/stubs/common.cc | 2 +- 3party/sgitess/gluos.h | 4 +- common.pri | 8 ++++ std/windows.hpp | 39 +++++++++++-------- 5 files changed, 35 insertions(+), 20 deletions(-) diff --git a/3party/gflags/src/mutex.h b/3party/gflags/src/mutex.h index 6e1e8976b6..82c1be209d 100644 --- a/3party/gflags/src/mutex.h +++ b/3party/gflags/src/mutex.h @@ -117,7 +117,7 @@ #if defined(NO_THREADS) typedef int MutexType; // to keep a lock-count #elif defined(_WIN32) || defined(__CYGWIN32__) || defined(__CYGWIN64__) -# define WIN32_LEAN_AND_MEAN // We only need minimal includes +//# define WIN32_LEAN_AND_MEAN // We only need minimal includes # ifdef GMUTEX_TRYLOCK // We need Windows NT or later for TryEnterCriticalSection(). If you // don't need that functionality, you can remove these _WIN32_WINNT diff --git a/3party/protobuf/src/google/protobuf/stubs/common.cc b/3party/protobuf/src/google/protobuf/stubs/common.cc index 12e14a898f..3b47cf0b92 100644 --- a/3party/protobuf/src/google/protobuf/stubs/common.cc +++ b/3party/protobuf/src/google/protobuf/stubs/common.cc @@ -39,7 +39,7 @@ //#include "config.h" #if defined(_WIN32) && !defined(_BADA_SIMULATOR) && !defined(_BADA_DEVICE) -#define WIN32_LEAN_AND_MEAN // We only need minimal includes +//#define WIN32_LEAN_AND_MEAN // We only need minimal includes #include #define snprintf _snprintf // see comment in strutil.cc #elif defined(HAVE_PTHREAD) diff --git a/3party/sgitess/gluos.h b/3party/sgitess/gluos.h index 94fe6d5436..15f5850b06 100644 --- a/3party/sgitess/gluos.h +++ b/3party/sgitess/gluos.h @@ -35,14 +35,14 @@ #include #include -#define WIN32_LEAN_AND_MEAN +//#define WIN32_LEAN_AND_MEAN #define NOGDI #define NOIME #ifndef NOMINMAX #define NOMINMAX #endif -#define _WIN32_WINNT 0x0400 +//#define _WIN32_WINNT 0x0400 #ifndef STRICT #define STRICT 1 #endif diff --git a/common.pri b/common.pri index 4e9020ad5b..434f596e2d 100644 --- a/common.pri +++ b/common.pri @@ -65,6 +65,14 @@ for(project, DEPENDENCIES) { INCLUDEPATH += $$ROOT_DIR/3party/protobuf/src/ +win32 { + DEFINES += _WIN32_WINNT=0x0501 + DEFINES += WINVER=0x0501 + DEFINES += _WIN32_IE=0x0501 + DEFINES += WIN32_LEAN_AND_MEAN=1 + DEFINES += NTDDI_VERSION=0x05010000 +} + # Windows-specific options for all projects win32-msvc2008 { QMAKE_CLEAN += *.user diff --git a/std/windows.hpp b/std/windows.hpp index 62f2b50947..3484605265 100644 --- a/std/windows.hpp +++ b/std/windows.hpp @@ -1,24 +1,31 @@ #pragma once -// we support only Vista and above at the moment (due to conditional variables) -#ifdef _WIN32_WINNT - #undef _WIN32_WINNT -#endif -#define _WIN32_WINNT 0x0600 +// These defines are moved to common.pri because +// they should be equal for all libraries, even for 3party ones -#ifdef WINVER - #undef WINVER -#endif -#define WINVER 0x0600 +//#ifdef _WIN32_WINNT +// #undef _WIN32_WINNT +//#endif +//#define _WIN32_WINNT 0x0501 -#ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN -#endif +//#ifdef WINVER +// #undef WINVER +//#endif +//#define WINVER 0x0501 -#ifdef _WIN32_IE - #undef _WIN32_IE -#endif -#define _WIN32_IE 0x0600 +//#ifndef WIN32_LEAN_AND_MEAN +// #define WIN32_LEAN_AND_MEAN 1 +//#endif + +//#ifdef _WIN32_IE +// #undef _WIN32_IE +//#endif +//#define _WIN32_IE 0x0501 + +//#ifdef NTDDI_VERSION +// #undef NTDDI_VERSION +//#endif +//#define NTDDI_VERSION 0x05010000 #include