From 3aa3002010bf407e3f23f8338cf1869dd3bd43f0 Mon Sep 17 00:00:00 2001 From: magumagu Date: Tue, 20 Jan 2015 14:54:53 -0800 Subject: [PATCH] Fix Intellisense error spam on Visual Studio. Intellisense doesn't like defines in PCH files, and it doesn't like the deleted constructor for BitField. (I think it's being overly strict about the "must have no non-default constructors" rule for classes in unions.) --- Source/Core/Common/BitField.h | 4 ++++ Source/PCH/pch.h | 13 ------------- Source/VSProps/Base.props | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Source/Core/Common/BitField.h b/Source/Core/Common/BitField.h index 9e1f094db4..c6044be558 100644 --- a/Source/Core/Common/BitField.h +++ b/Source/Core/Common/BitField.h @@ -115,10 +115,14 @@ template struct BitField { private: +#ifndef _WIN32 // This constructor might be considered ambiguous: // Would it initialize the storage or just the bitfield? // Hence, delete it. Use the assignment operator to set bitfield values! + // MSVC 2013 Intellisense complains that this declaration isn't allowed + // in a union member, so disable it on Windows. BitField(T val) = delete; +#endif public: // Force default constructor to be created diff --git a/Source/PCH/pch.h b/Source/PCH/pch.h index bddae06dee..5402a27a44 100644 --- a/Source/PCH/pch.h +++ b/Source/PCH/pch.h @@ -67,19 +67,6 @@ #error Please update your build environment to VS2013 with Update 3 or later! #endif -// This numeral indicates the "minimum system required" to run the resulting -// program. Dolphin targets Vista+, so it should be 0x0600. However in practice, -// _WIN32_WINNT just removes up-level API declarations from headers. This is a -// problem for XAudio2 and XInput, where Dolphin expects to compile against the -// Win8+ versions of their headers. So while we really need Vista+ level of -// support, we declare Win8+ here globally. If this becomes a problem, the -// higher declaration can be contained to just the XAudio2/XInput related code. -#define _WIN32_WINNT 0x0602 - -// Exclude rarely-used stuff from Windows headers -#define WIN32_LEAN_AND_MEAN -// Don't include Windows min/max definitions. They would conflict with the STL. -#define NOMINMAX #include #endif diff --git a/Source/VSProps/Base.props b/Source/VSProps/Base.props index 3e447b5420..a1abd19963 100644 --- a/Source/VSProps/Base.props +++ b/Source/VSProps/Base.props @@ -53,6 +53,20 @@ PSAPI_VERSION=1;_M_X86=1;%(PreprocessorDefinitions) SFML_STATIC;%(PreprocessorDefinitions) _ARCH_64=1;_M_X86_64=1;%(PreprocessorDefinitions) + + WIN32_LEAN_AND_MEAN;NOMINMAX;%(PreprocessorDefinitions) + + _WIN32_WINNT=0x0602;%(PreprocessorDefinitions) Level3 true true