Skip to content

Commit

Permalink
Fix Intellisense error spam on Visual Studio.
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
magumagu committed Jan 24, 2015
1 parent 0b1d8fa commit 3aa3002
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
4 changes: 4 additions & 0 deletions Source/Core/Common/BitField.h
Expand Up @@ -115,10 +115,14 @@ template<std::size_t position, std::size_t bits, typename T>
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
Expand Down
13 changes: 0 additions & 13 deletions Source/PCH/pch.h
Expand Up @@ -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 <Windows.h>

#endif
Expand Down
14 changes: 14 additions & 0 deletions Source/VSProps/Base.props
Expand Up @@ -53,6 +53,20 @@
<PreprocessorDefinitions>PSAPI_VERSION=1;_M_X86=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>SFML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='x64'">_ARCH_64=1;_M_X86_64=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!--
Make sure we include a clean version of windows.h.
-->
<PreprocessorDefinitions Condition="'$(ProjectName)'!='portaudio' And '$(ProjectName)'!='wxWidgets'">WIN32_LEAN_AND_MEAN;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!--
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.
-->
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<IntrinsicFunctions>true</IntrinsicFunctions>
Expand Down

0 comments on commit 3aa3002

Please sign in to comment.