summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2014-07-28 21:06:37 +1200
committerMatthew Parlane <parlane@gmail.com>2014-07-28 21:06:37 +1200
commit3554a15180cf03892dea73d543e36ffa08965ca2 (patch)
treefe5c82dab6e934eb14fbefd36a08348c11ce6145 /Source/Core
parent86db0040b7402342f1559c22034adcd3921920b7 (diff)
parent4fa71dd59ead7e6590592f036c3d4f9f63ab581a (diff)
Merge pull request #680 from lioncash/fakepoll-removal
Remove fakepoll.h
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/AudioCommon/stdafx.h15
-rw-r--r--Source/Core/Common/stdafx.h17
-rw-r--r--Source/Core/Core/Core.vcxproj5
-rw-r--r--Source/Core/Core/Core.vcxproj.filters7
-rw-r--r--Source/Core/Core/HW/WiimoteReal/IOWin.cpp4
-rw-r--r--Source/Core/Core/IPC_HLE/ICMP.h2
-rw-r--r--Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp2
-rw-r--r--Source/Core/Core/IPC_HLE/WII_Socket.h6
-rw-r--r--Source/Core/Core/IPC_HLE/fakepoll.h165
-rw-r--r--Source/Core/Core/stdafx.h6
-rw-r--r--Source/Core/DiscIO/stdafx.h9
-rw-r--r--Source/Core/DolphinWX/stdafx.h7
-rw-r--r--Source/Core/InputCommon/stdafx.h13
-rw-r--r--Source/Core/VideoBackends/D3D/stdafx.h7
-rw-r--r--Source/Core/VideoBackends/OGL/stdafx.h7
-rw-r--r--Source/Core/VideoBackends/Software/stdafx.h7
16 files changed, 41 insertions, 238 deletions
diff --git a/Source/Core/AudioCommon/stdafx.h b/Source/Core/AudioCommon/stdafx.h
index 37663533a9..7257e555ab 100644
--- a/Source/Core/AudioCommon/stdafx.h
+++ b/Source/Core/AudioCommon/stdafx.h
@@ -3,14 +3,13 @@
// Refer to the license.txt file included.
#pragma once
-/*
-#ifdef HAVE_DXSDK_JUNE_2010
-#define _WIN32_WINNT 0x501
-#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
-#endif
-*/
+
+// Windows Vista is the lowest version we support
+// BUT We need to use the headers for Win8+ XAudio2, so Win8 version is used here.
+// The XAudio2 code will gracefully fallback to older versions if the new one
+// isn't available at runtime.
+#define _WIN32_WINNT 0x0602
+
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX // Don't include windows min/max definitions
diff --git a/Source/Core/Common/stdafx.h b/Source/Core/Common/stdafx.h
index 3142ff68d2..1cbeb9d7e3 100644
--- a/Source/Core/Common/stdafx.h
+++ b/Source/Core/Common/stdafx.h
@@ -4,23 +4,12 @@
#pragma once
-/*
-#ifndef _WIN32_WINNT
- #define _WIN32_WINNT 0x501
-#endif
-#ifndef _WIN32_IE
-#define _WIN32_IE 0x0500 // Default value is 0x0400
-#endif
-*/
+// Windows Vista is the lowest version we support
+#define _WIN32_WINNT 0x0600
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX // Don't include windows min/max definitions
-/*
-#define _CRT_SECURE_NO_DEPRECATE 1
-#define _CRT_NONSTDC_NO_DEPRECATE 1
-*/
#include <tchar.h>
#include <vector>
-#include <windows.h>
-
+#include <Windows.h>
diff --git a/Source/Core/Core/Core.vcxproj b/Source/Core/Core/Core.vcxproj
index 66926be20f..8468acad0f 100644
--- a/Source/Core/Core/Core.vcxproj
+++ b/Source/Core/Core/Core.vcxproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
@@ -362,7 +362,6 @@
<ClInclude Include="HW\WiimoteReal\WiimoteReal.h" />
<ClInclude Include="HW\WiimoteReal\WiimoteRealBase.h" />
<ClInclude Include="HW\WII_IPC.h" />
- <ClInclude Include="IPC_HLE\fakepoll.h" />
<ClInclude Include="IPC_HLE\hci.h" />
<ClInclude Include="IPC_HLE\ICMP.h" />
<ClInclude Include="IPC_HLE\l2cap.h" />
@@ -463,4 +462,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
+</Project> \ No newline at end of file
diff --git a/Source/Core/Core/Core.vcxproj.filters b/Source/Core/Core/Core.vcxproj.filters
index 789f44a418..62b98bc4fd 100644
--- a/Source/Core/Core/Core.vcxproj.filters
+++ b/Source/Core/Core/Core.vcxproj.filters
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="ActionReplay">
@@ -1107,9 +1107,6 @@
<ClInclude Include="IPC_HLE\WII_IPC_HLE_Device_usb_kbd.h">
<Filter>IPC HLE %28IOS/Starlet%29\Keyboard</Filter>
</ClInclude>
- <ClInclude Include="IPC_HLE\fakepoll.h">
- <Filter>IPC HLE %28IOS/Starlet%29\Net</Filter>
- </ClInclude>
<ClInclude Include="IPC_HLE\ICMP.h">
<Filter>IPC HLE %28IOS/Starlet%29\Net</Filter>
</ClInclude>
@@ -1214,4 +1211,4 @@
<ItemGroup>
<Text Include="CMakeLists.txt" />
</ItemGroup>
-</Project>
+</Project> \ No newline at end of file
diff --git a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp
index 1413ed76bc..82c5b935b2 100644
--- a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp
+++ b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp
@@ -2,10 +2,6 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
-// Used for pair up
-#undef NTDDI_VERSION
-#define NTDDI_VERSION NTDDI_WINXPSP2
-
#include <algorithm>
#include <cstdio>
#include <cstdlib>
diff --git a/Source/Core/Core/IPC_HLE/ICMP.h b/Source/Core/Core/IPC_HLE/ICMP.h
index 2b3b49bb23..3c136dccaa 100644
--- a/Source/Core/Core/IPC_HLE/ICMP.h
+++ b/Source/Core/Core/IPC_HLE/ICMP.h
@@ -1,7 +1,7 @@
#pragma once
#ifdef _WIN32
-#include <winsock2.h>
+#include <WinSock2.h>
#else
#include <netinet/in.h>
#endif
diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp
index b995111a24..4282421d15 100644
--- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp
+++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp
@@ -24,9 +24,7 @@
#ifdef _WIN32
#include <ws2tcpip.h>
#include <iphlpapi.h>
-#include <iphlpapi.h>
-#include "Core/IPC_HLE/fakepoll.h"
#define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
diff --git a/Source/Core/Core/IPC_HLE/WII_Socket.h b/Source/Core/Core/IPC_HLE/WII_Socket.h
index 5899dd7e54..5c65232ea8 100644
--- a/Source/Core/Core/IPC_HLE/WII_Socket.h
+++ b/Source/Core/Core/IPC_HLE/WII_Socket.h
@@ -7,9 +7,11 @@
#ifdef _WIN32
#include <ws2tcpip.h>
#include <iphlpapi.h>
-#include <iphlpapi.h>
+#include <WinSock2.h>
+
+typedef pollfd pollfd_t;
-#include "fakepoll.h"
+#define poll WSAPoll
#define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x))
#define FREE(x) HeapFree(GetProcessHeap(), 0, (x))
diff --git a/Source/Core/Core/IPC_HLE/fakepoll.h b/Source/Core/Core/IPC_HLE/fakepoll.h
deleted file mode 100644
index 2f779682e9..0000000000
--- a/Source/Core/Core/IPC_HLE/fakepoll.h
+++ /dev/null
@@ -1,165 +0,0 @@
-// fakepoll.h
-// poll using select
-//Matthew Parlane sourced this from http://www.sealiesoftware.com/
-//Was listed as "Public domain." as of 31/07/2010
-
-// Warning: a call to this poll() takes about 4K of stack space.
-
-// Greg Parker gparker-web@sealiesoftware.com December 2000
-// This code is in the public domain and may be copied or modified without
-// permission.
-
-// Updated May 2002:
-// * fix crash when an fd is less than 0
-// * set errno=EINVAL if an fd is greater or equal to FD_SETSIZE
-// * don't set POLLIN or POLLOUT in revents if it wasn't requested
-// in events (only happens when an fd is in the poll set twice)
-
-#pragma once
-
-#if (_WIN32_WINNT < _WIN32_WINNT_VISTA)
-
-#include <limits.h>
-#include <sys/types.h>
-#include <stdlib.h>
-
-typedef struct pollfd {
- int fd; /* file desc to poll */
- int events; /* events of interest on fd */
- int revents; /* events that occurred on fd */
-} pollfd_t;
-
-#define EINVAL 22
-// poll flags
-#define POLLIN 0x0001
-#define POLLOUT 0x0008
-#define POLLERR 0x0020
-
-// synonyms
-#define POLLNORM POLLIN
-#define POLLPRI POLLIN
-#define POLLRDNORM POLLIN
-#define POLLRDBAND POLLIN
-#define POLLWRNORM POLLOUT
-#define POLLWRBAND POLLOUT
-
-// ignored
-#define POLLHUP 0x0040
-#define POLLNVAL 0x0080
-
-inline int poll(struct pollfd *pollSet, int pollCount, int pollTimeout)
-{
- struct timeval tv;
- struct timeval *tvp;
- fd_set readFDs, writeFDs, exceptFDs;
- fd_set *readp, *writep, *exceptp;
- struct pollfd *pollEnd, *p;
- int selected;
- int result;
- int maxFD;
-
- if (!pollSet) {
- pollEnd = nullptr;
- readp = nullptr;
- writep = nullptr;
- exceptp = nullptr;
- maxFD = 0;
- }
- else {
- pollEnd = pollSet + pollCount;
- readp = &readFDs;
- writep = &writeFDs;
- exceptp = &exceptFDs;
-
- FD_ZERO(readp);
- FD_ZERO(writep);
- FD_ZERO(exceptp);
-
- // Find the biggest fd in the poll set
- maxFD = 0;
- for (p = pollSet; p < pollEnd; p++) {
- if (p->fd > maxFD) maxFD = p->fd;
- }
-
- // Transcribe flags from the poll set to the fd sets
- for (p = pollSet; p < pollEnd; p++) {
- if (p->fd < 0) {
- // Negative fd checks nothing and always reports zero
- } else {
- if (p->events & POLLIN) FD_SET(p->fd, readp);
- if (p->events & POLLOUT) FD_SET(p->fd, writep);
- if (p->events != 0) FD_SET(p->fd, exceptp);
- // POLLERR is never set coming in; poll() always reports errors
- // But don't report if we're not listening to anything at all.
- }
- }
- }
-
- // poll timeout is in milliseconds. Convert to struct timeval.
- // poll timeout == -1 : wait forever : select timeout of nullptr
- // poll timeout == 0 : return immediately : select timeout of zero
- if (pollTimeout >= 0) {
- tv.tv_sec = pollTimeout / 1000;
- tv.tv_usec = (pollTimeout % 1000) * 1000;
- tvp = &tv;
- } else {
- tvp = nullptr;
- }
-
-
- selected = select(maxFD+1, readp, writep, exceptp, tvp);
-
-
- if (selected < 0) {
- // Error during select
- result = -1;
- }
- else if (selected > 0) {
- // Select found something
- // Transcribe result from fd sets to poll set.
- // Also count the number of selected fds. poll returns the
- // number of ready fds; select returns the number of bits set.
- int polled = 0;
- for (p = pollSet; p < pollEnd; p++) {
- p->revents = 0;
- if (p->fd < 0) {
- // Negative fd always reports zero
- } else {
- int isToRead = FD_ISSET(p->fd, readp);
- if ((p->events & POLLIN) && isToRead) {
- p->revents |= POLLIN;
- }
-
- int isToWrite = FD_ISSET(p->fd, writep);
- if ((p->events & POLLOUT) && isToWrite) {
- p->revents |= POLLOUT;
- }
-
- int isToError = FD_ISSET(p->fd, exceptp);
- if ((p->events != 0) && isToError) {
- p->revents |= POLLERR;
- }
-
- if (p->revents) polled++;
- }
- }
- result = polled;
- }
- else {
- // selected == 0, select timed out before anything happened
- // Clear all result bits and return zero.
- for (p = pollSet; p < pollEnd; p++) {
- p->revents = 0;
-
- }
- result = 0;
- }
- return result;
-}
-
-#else // (_WIN32_WINNT < _WIN32_WINNT_VISTA)
-
-typedef pollfd pollfd_t;
-#define poll WSAPoll
-
-#endif
diff --git a/Source/Core/Core/stdafx.h b/Source/Core/Core/stdafx.h
index 735aea396a..4aba74d79f 100644
--- a/Source/Core/Core/stdafx.h
+++ b/Source/Core/Core/stdafx.h
@@ -4,10 +4,8 @@
#pragma once
-#define _WIN32_WINNT 0x501
-#ifndef _WIN32_IE
-#define _WIN32_IE 0x0500 // Default value is 0x0400
-#endif
+// Windows Vista is the lowest version we support
+#define _WIN32_WINNT 0x0600
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX // Don't include windows min/max definitions
diff --git a/Source/Core/DiscIO/stdafx.h b/Source/Core/DiscIO/stdafx.h
index 19ed0290e7..89cd55b4d8 100644
--- a/Source/Core/DiscIO/stdafx.h
+++ b/Source/Core/DiscIO/stdafx.h
@@ -4,17 +4,12 @@
#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.
-#endif
+// Windows Vista is the lowest version we support
+#define _WIN32_WINNT 0x0600
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX // Don't include windows min/max definitions
-#ifndef _CRT_SECURE_NO_DEPRECATE
-#define _CRT_SECURE_NO_DEPRECATE
-#endif
-
// TODO: reference additional headers your program requires here
#include <algorithm>
diff --git a/Source/Core/DolphinWX/stdafx.h b/Source/Core/DolphinWX/stdafx.h
index 9253fc3e09..547b0eb264 100644
--- a/Source/Core/DolphinWX/stdafx.h
+++ b/Source/Core/DolphinWX/stdafx.h
@@ -6,11 +6,8 @@
#ifdef _WIN32
-// Change these values to use different versions
-#define WINVER 0x0400
-#define _WIN32_WINNT 0x0501
-#define _WIN32_IE 0x0500
-#define _RICHEDIT_VER 0x0100
+// Windows Vista is the lowest version we support
+#define _WIN32_WINNT 0x0600
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX // Don't include windows min/max definitions
diff --git a/Source/Core/InputCommon/stdafx.h b/Source/Core/InputCommon/stdafx.h
index cd18106bfc..1ae6b686cd 100644
--- a/Source/Core/InputCommon/stdafx.h
+++ b/Source/Core/InputCommon/stdafx.h
@@ -3,12 +3,13 @@
// Refer to the license.txt file included.
#pragma once
-/*
-#define _WIN32_WINNT 0x501
-#ifndef _WIN32_IE
-#define _WIN32_IE 0x0500 // Default value is 0x0400
-#endif
-*/
+
+// Windows Vista is the lowest version we support
+// BUT We need to use the headers for Win8+ XInput, so Win8 version is used here.
+// The XInput code will gracefully fallback to older versions if the new one
+// isn't available at runtime.
+#define _WIN32_WINNT 0x0602
+
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX // Don't include windows min/max definitions
diff --git a/Source/Core/VideoBackends/D3D/stdafx.h b/Source/Core/VideoBackends/D3D/stdafx.h
index d245b07645..2d22e3c8dc 100644
--- a/Source/Core/VideoBackends/D3D/stdafx.h
+++ b/Source/Core/VideoBackends/D3D/stdafx.h
@@ -3,10 +3,9 @@
// Refer to the license.txt file included.
#pragma once
-#define _WIN32_WINNT 0x501
-#ifndef _WIN32_IE
-#define _WIN32_IE 0x0500 // Default value is 0x0400
-#endif
+
+// Windows Vista is the lowest version we support
+#define _WIN32_WINNT 0x0600
#define NOMINMAX // Don't include windows min/max definitions
diff --git a/Source/Core/VideoBackends/OGL/stdafx.h b/Source/Core/VideoBackends/OGL/stdafx.h
index d245b07645..2d22e3c8dc 100644
--- a/Source/Core/VideoBackends/OGL/stdafx.h
+++ b/Source/Core/VideoBackends/OGL/stdafx.h
@@ -3,10 +3,9 @@
// Refer to the license.txt file included.
#pragma once
-#define _WIN32_WINNT 0x501
-#ifndef _WIN32_IE
-#define _WIN32_IE 0x0500 // Default value is 0x0400
-#endif
+
+// Windows Vista is the lowest version we support
+#define _WIN32_WINNT 0x0600
#define NOMINMAX // Don't include windows min/max definitions
diff --git a/Source/Core/VideoBackends/Software/stdafx.h b/Source/Core/VideoBackends/Software/stdafx.h
index 76dce7c64f..3ebfc6a7b1 100644
--- a/Source/Core/VideoBackends/Software/stdafx.h
+++ b/Source/Core/VideoBackends/Software/stdafx.h
@@ -3,10 +3,9 @@
// Refer to the license.txt file included.
#pragma once
-#define _WIN32_WINNT 0x501
-#ifndef _WIN32_IE
-#define _WIN32_IE 0x0500 // Default value is 0x0400
-#endif
+
+// Windows Vista is the lowest version we support
+#define _WIN32_WINNT 0x0600
#define NOMINMAX // Don't include windows min/max definitions