Skip to content

Instantly share code, notes, and snippets.

@pinumbernumber
Created April 11, 2014 20:37
Show Gist options
  • Save pinumbernumber/10499623 to your computer and use it in GitHub Desktop.
Save pinumbernumber/10499623 to your computer and use it in GitHub Desktop.
dolphin post-xp threading
commit e5fa48b86183c42608de0fb24c101d394ce4b16f
Author: pinumbernumber <1337rz@gmail.com>
Date: Fri Apr 11 21:24:37 2014 +0100
use post-XP threading primitives on Windows
diff --git a/Externals/miniupnpc/CMakeLists.txt b/Externals/miniupnpc/CMakeLists.txt
index 404ef65..67b7104 100644
--- a/Externals/miniupnpc/CMakeLists.txt
+++ b/Externals/miniupnpc/CMakeLists.txt
@@ -8,7 +8,7 @@ if(UNIX)
add_definitions(-DMINIUPNPC_SET_SOCKET_TIMEOUT)
add_definitions(-D_BSD_SOURCE -D_POSIX_C_SOURCE=1)
elseif(WIN32)
- add_definitions(-D_WIN32_WINNT=0x0501)
+ add_definitions(-D_WIN32_WINNT=0x0601)
find_library(WINSOCK2_LIBRARY NAMES ws2_32 WS2_32 Ws2_32)
find_library(IPHLPAPI_LIBRARY NAMES iphlpapi)
set(LDLIBS ${WINSOCK2_LIBRARY} ${IPHLPAPI_LIBRARY} ${LDLIBS})
diff --git a/Externals/polarssl/library/net.c b/Externals/polarssl/library/net.c
index 24dd95e..84106d5 100644
--- a/Externals/polarssl/library/net.c
+++ b/Externals/polarssl/library/net.c
@@ -33,7 +33,7 @@
!defined(EFI32)
#if defined(POLARSSL_HAVE_IPV6)
-#define _WIN32_WINNT 0x0501
+#define _WIN32_WINNT 0x0601
#include <ws2tcpip.h>
#endif
diff --git a/Externals/portaudio/src/hostapi/wdmks/pa_win_wdmks.c b/Externals/portaudio/src/hostapi/wdmks/pa_win_wdmks.c
index 60a61e4..e9f4642 100644
--- a/Externals/portaudio/src/hostapi/wdmks/pa_win_wdmks.c
+++ b/Externals/portaudio/src/hostapi/wdmks/pa_win_wdmks.c
@@ -59,8 +59,8 @@
#ifdef __GNUC__
#include <initguid.h>
- #define _WIN32_WINNT 0x0501
- #define WINVER 0x0501
+ #define _WIN32_WINNT 0x0601
+ #define WINVER 0x0601
#endif
#include <string.h> /* strlen() */
diff --git a/Source/Core/AudioCommon/stdafx.h b/Source/Core/AudioCommon/stdafx.h
index e28b312..443b71a 100644
--- a/Source/Core/AudioCommon/stdafx.h
+++ b/Source/Core/AudioCommon/stdafx.h
@@ -5,7 +5,7 @@
#pragma once
/*
#ifdef HAVE_DXSDK_JUNE_2010
-#define _WIN32_WINNT 0x501
+#define _WIN32_WINNT 0x0601
#else
#pragma message("Resulting binary will be compatible with DirectX >= Windows 8. Install the June 2010 DirectX SDK if you want to build for older environments.")
#define _WIN32_WINNT 0x602
diff --git a/Source/Core/Common/LogManager.cpp b/Source/Core/Common/LogManager.cpp
index bc4f930..08c198b 100644
--- a/Source/Core/Common/LogManager.cpp
+++ b/Source/Core/Common/LogManager.cpp
@@ -4,7 +4,7 @@
#include <cstdarg>
#include <cstring>
-#include <mutex>
+#include "Common/StdMutex.h"
#include <ostream>
#include <set>
#include <string>
diff --git a/Source/Core/Common/StdConditionVariable.h b/Source/Core/Common/StdConditionVariable.h
index f639acf..fed1417 100644
--- a/Source/Core/Common/StdConditionVariable.h
+++ b/Source/Core/Common/StdConditionVariable.h
@@ -25,7 +25,7 @@
#include <condition_variable> // IWYU pragma: export
-#elif _MSC_VER >= 1700
+#elif 0 //_MSC_VER >= 1700
// The standard implementation is included since VS2012
#include <condition_variable> // IWYU pragma: export
diff --git a/Source/Core/Common/StdMutex.h b/Source/Core/Common/StdMutex.h
index 94afc35..f10eda7 100644
--- a/Source/Core/Common/StdMutex.h
+++ b/Source/Core/Common/StdMutex.h
@@ -18,7 +18,7 @@
// Clang + libc++
#include <mutex> // IWYU pragma: export
-#elif _MSC_VER >= 1700
+#elif 0 //_MSC_VER >= 1700
// The standard implementation is included since VS2012
#include <mutex> // IWYU pragma: export
diff --git a/Source/Core/Common/StdThread.h b/Source/Core/Common/StdThread.h
index 787f25a..166007e 100644
--- a/Source/Core/Common/StdThread.h
+++ b/Source/Core/Common/StdThread.h
@@ -21,7 +21,7 @@
// Clang + libc++
#include <thread> // IWYU pragma: export
-#elif _MSC_VER >= 1700
+#elif 0 //_MSC_VER >= 1700
// The standard implementation is included since VS2012
#include <thread> // IWYU pragma: export
diff --git a/Source/Core/Common/stdafx.h b/Source/Core/Common/stdafx.h
index 832a942..1cdf312 100644
--- a/Source/Core/Common/stdafx.h
+++ b/Source/Core/Common/stdafx.h
@@ -6,7 +6,7 @@
/*
#ifndef _WIN32_WINNT
- #define _WIN32_WINNT 0x501
+ #define _WIN32_WINNT 0x0601
#endif
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500 // Default value is 0x0400
diff --git a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp
index 760f0b4..def6286 100644
--- a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp
+++ b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp
@@ -4,7 +4,7 @@
// Used for pair up
#undef NTDDI_VERSION
-#define NTDDI_VERSION NTDDI_WINXPSP2
+#define NTDDI_VERSION NTDDI_WIN7
#include <algorithm>
#include <cstdio>
diff --git a/Source/Core/Core/stdafx.h b/Source/Core/Core/stdafx.h
index 167fccc..774cc05 100644
--- a/Source/Core/Core/stdafx.h
+++ b/Source/Core/Core/stdafx.h
@@ -4,7 +4,7 @@
#pragma once
-#define _WIN32_WINNT 0x501
+#define _WIN32_WINNT 0x0601
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500 // Default value is 0x0400
#endif
diff --git a/Source/Core/DiscIO/FileMonitor.cpp b/Source/Core/DiscIO/FileMonitor.cpp
index cdbb885..8edaf7f 100644
--- a/Source/Core/DiscIO/FileMonitor.cpp
+++ b/Source/Core/DiscIO/FileMonitor.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
+#define _WIN32_WINNT 0x0601
+
#include <algorithm>
#include <cctype>
#include <cstring>
diff --git a/Source/Core/DiscIO/stdafx.h b/Source/Core/DiscIO/stdafx.h
index 03a92c3..d8a6099 100644
--- a/Source/Core/DiscIO/stdafx.h
+++ b/Source/Core/DiscIO/stdafx.h
@@ -5,7 +5,7 @@
#pragma once
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
-#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
+#define _WIN32_WINNT 0x0601 // Change this to the appropriate value to target other versions of Windows.
#endif
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
diff --git a/Source/Core/DolphinWX/CheatsWindow.cpp b/Source/Core/DolphinWX/CheatsWindow.cpp
index c89e16f..030877e 100644
--- a/Source/Core/DolphinWX/CheatsWindow.cpp
+++ b/Source/Core/DolphinWX/CheatsWindow.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
+#define _WIN32_WINNT 0x0601
+
#include <climits>
#include <cstddef>
#include <cstdio>
diff --git a/Source/Core/DolphinWX/DolphinWX.vcxproj b/Source/Core/DolphinWX/DolphinWX.vcxproj
index db73e05..ee10682 100644
--- a/Source/Core/DolphinWX/DolphinWX.vcxproj
+++ b/Source/Core/DolphinWX/DolphinWX.vcxproj
@@ -50,6 +50,9 @@
<FixedBaseAddress>true</FixedBaseAddress>
<AdditionalLibraryDirectories>..\..\..\Externals\SDL2-2.0.1\lib\$(PlatformName);..\..\..\Externals\OpenAL\$(PlatformName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dsound.lib;iphlpapi.lib;winmm.lib;setupapi.lib;vfw32.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;OpenAL32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <Profile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</Profile>
+ <Profile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</Profile>
+ <TreatLinkerWarningAsErrors Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</TreatLinkerWarningAsErrors>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\Externals\wxWidgets3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
diff --git a/Source/Core/DolphinWX/FifoPlayerDlg.cpp b/Source/Core/DolphinWX/FifoPlayerDlg.cpp
index 0159798..c8443f1 100644
--- a/Source/Core/DolphinWX/FifoPlayerDlg.cpp
+++ b/Source/Core/DolphinWX/FifoPlayerDlg.cpp
@@ -4,7 +4,7 @@
#include <algorithm>
#include <cstddef>
-#include <mutex>
+#include "Common/StdMutex.h"
#include <string>
#include <vector>
diff --git a/Source/Core/DolphinWX/Frame.h b/Source/Core/DolphinWX/Frame.h
index 8f7e073..a167e81 100644
--- a/Source/Core/DolphinWX/Frame.h
+++ b/Source/Core/DolphinWX/Frame.h
@@ -5,7 +5,7 @@
#pragma once
#include <cstddef>
-#include <mutex>
+#include "Common/StdMutex.h"
#include <string>
#include <vector>
#include <wx/bitmap.h>
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index 1fa0716..eb4e30b 100644
--- a/Source/Core/DolphinWX/FrameTools.cpp
+++ b/Source/Core/DolphinWX/FrameTools.cpp
@@ -16,7 +16,7 @@ Core::GetWindowHandle().
#include <cstdarg>
#include <cstdio>
-#include <mutex>
+#include "Common/StdMutex.h"
#include <string>
#include <vector>
#include <wx/app.h>
diff --git a/Source/Core/DolphinWX/InputConfigDiag.cpp b/Source/Core/DolphinWX/InputConfigDiag.cpp
index ef38ca5..9379a6f 100644
--- a/Source/Core/DolphinWX/InputConfigDiag.cpp
+++ b/Source/Core/DolphinWX/InputConfigDiag.cpp
@@ -6,7 +6,7 @@
#include <cctype>
#include <cstddef>
#include <memory>
-#include <mutex>
+#include "Common/StdMutex.h"
#include <string>
#include <vector>
#include <wx/app.h>
diff --git a/Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp b/Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp
index e1bc6bd..87a2a8f 100644
--- a/Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp
+++ b/Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp
@@ -4,7 +4,7 @@
#include <cstring>
#include <memory>
-#include <mutex>
+#include "Common/StdMutex.h"
#include <string>
#include <vector>
#include <wx/bitmap.h>
diff --git a/Source/Core/DolphinWX/LogWindow.cpp b/Source/Core/DolphinWX/LogWindow.cpp
index 84413c9..3a3e5c3 100644
--- a/Source/Core/DolphinWX/LogWindow.cpp
+++ b/Source/Core/DolphinWX/LogWindow.cpp
@@ -3,7 +3,7 @@
// Refer to the license.txt file included.
#include <cstddef>
-#include <mutex>
+#include "Common/StdMutex.h"
#include <queue>
#include <utility>
#include <vector>
diff --git a/Source/Core/DolphinWX/LogWindow.h b/Source/Core/DolphinWX/LogWindow.h
index c3797e9..7bcc452 100644
--- a/Source/Core/DolphinWX/LogWindow.h
+++ b/Source/Core/DolphinWX/LogWindow.h
@@ -4,7 +4,7 @@
#pragma once
-#include <mutex>
+#include "Common/StdMutex.h"
#include <queue>
#include <utility>
#include <vector>
diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp
index 60574d9..bf5d491 100644
--- a/Source/Core/DolphinWX/Main.cpp
+++ b/Source/Core/DolphinWX/Main.cpp
@@ -5,7 +5,7 @@
#include <cstdarg>
#include <cstdio>
#include <cstring>
-#include <mutex>
+#include "Common/StdMutex.h"
#include <string>
#include <utility>
#include <wx/app.h>
diff --git a/Source/Core/DolphinWX/stdafx.h b/Source/Core/DolphinWX/stdafx.h
index 8adaf25..646140e 100644
--- a/Source/Core/DolphinWX/stdafx.h
+++ b/Source/Core/DolphinWX/stdafx.h
@@ -8,7 +8,7 @@
// Change these values to use different versions
#define WINVER 0x0400
-#define _WIN32_WINNT 0x0501
+#define _WIN32_WINNT 0x0601
#define _WIN32_IE 0x0500
#define _RICHEDIT_VER 0x0100
diff --git a/Source/Core/InputCommon/stdafx.h b/Source/Core/InputCommon/stdafx.h
index 613c899..d876113 100644
--- a/Source/Core/InputCommon/stdafx.h
+++ b/Source/Core/InputCommon/stdafx.h
@@ -4,7 +4,7 @@
#pragma once
/*
-#define _WIN32_WINNT 0x501
+#define _WIN32_WINNT 0x0601
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500 // Default value is 0x0400
#endif
diff --git a/Source/Core/VideoBackends/D3D/stdafx.h b/Source/Core/VideoBackends/D3D/stdafx.h
index 81bb44d..0275cf9 100644
--- a/Source/Core/VideoBackends/D3D/stdafx.h
+++ b/Source/Core/VideoBackends/D3D/stdafx.h
@@ -3,7 +3,7 @@
// Refer to the license.txt file included.
#pragma once
-#define _WIN32_WINNT 0x501
+#define _WIN32_WINNT 0x0601
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500 // Default value is 0x0400
#endif
diff --git a/Source/Core/VideoBackends/OGL/stdafx.h b/Source/Core/VideoBackends/OGL/stdafx.h
index 81bb44d..0275cf9 100644
--- a/Source/Core/VideoBackends/OGL/stdafx.h
+++ b/Source/Core/VideoBackends/OGL/stdafx.h
@@ -3,7 +3,7 @@
// Refer to the license.txt file included.
#pragma once
-#define _WIN32_WINNT 0x501
+#define _WIN32_WINNT 0x0601
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500 // Default value is 0x0400
#endif
diff --git a/Source/Core/VideoBackends/Software/stdafx.h b/Source/Core/VideoBackends/Software/stdafx.h
index 9d8868e..2753074 100644
--- a/Source/Core/VideoBackends/Software/stdafx.h
+++ b/Source/Core/VideoBackends/Software/stdafx.h
@@ -3,7 +3,7 @@
// Refer to the license.txt file included.
#pragma once
-#define _WIN32_WINNT 0x501
+#define _WIN32_WINNT 0x0601
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500 // Default value is 0x0400
#endif
diff --git a/Source/Core/VideoCommon/stdafx.h b/Source/Core/VideoCommon/stdafx.h
index 167fccc..774cc05 100644
--- a/Source/Core/VideoCommon/stdafx.h
+++ b/Source/Core/VideoCommon/stdafx.h
@@ -4,7 +4,7 @@
#pragma once
-#define _WIN32_WINNT 0x501
+#define _WIN32_WINNT 0x0601
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500 // Default value is 0x0400
#endif
diff --git a/Source/dolphin-emu.sln b/Source/dolphin-emu.sln
index 328f8d0..0a5f127 100644
--- a/Source/dolphin-emu.sln
+++ b/Source/dolphin-emu.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DolphinWX", "Core\DolphinWX\DolphinWX.vcxproj", "{47411FDB-1BF2-48D0-AB4E-C7C41160F898}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dolphin", "Core\DolphinWX\DolphinWX.vcxproj", "{47411FDB-1BF2-48D0-AB4E-C7C41160F898}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "Core\Core\Core.vcxproj", "{E54CF649-140E-4255-81A5-30A673C1FB36}"
EndProject
@@ -291,8 +291,11 @@ Global
{93D73454-2512-424E-9CDA-4BB357FE13DD} = {87ADDFF9-5768-4DA2-A33B-2477593D6677}
{349EE8F9-7D25-4909-AAF5-FF3FADE72187} = {87ADDFF9-5768-4DA2-A33B-2477593D6677}
{0A18A071-125E-442F-AFF7-A3F68ABECF99} = {87ADDFF9-5768-4DA2-A33B-2477593D6677}
- {96020103-4BA5-4FD2-B4AA-5B6D24492D4E} = {AAD1BCD6-9804-44A5-A5FC-4782EA00E9D4}
{EC1A314C-5588-4506-9C1E-2E58E5817F75} = {AAD1BCD6-9804-44A5-A5FC-4782EA00E9D4}
{A4C423AA-F57C-46C7-A172-D1A777017D29} = {AAD1BCD6-9804-44A5-A5FC-4782EA00E9D4}
+ {96020103-4BA5-4FD2-B4AA-5B6D24492D4E} = {AAD1BCD6-9804-44A5-A5FC-4782EA00E9D4}
+ EndGlobalSection
+ GlobalSection(Performance) = preSolution
+ HasPerformanceSessions = true
EndGlobalSection
EndGlobal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment