WIN32: Move all ARRAYSIZE undefs to util.h

Instead of trying to undefine ARRAYSIZE everywhere we use a Windows header, let's just do it before we define our own
This commit is contained in:
SupSuper 2018-12-16 21:56:19 +00:00 committed by Filippos Karapetis
parent 0a60e6ac8d
commit d0512db25c
13 changed files with 4 additions and 30 deletions

View file

@ -46,7 +46,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
#include "backends/audiocd/win32/win32-audiocd.h"

View file

@ -56,9 +56,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#if defined(ARRAYSIZE)
#undef ARRAYSIZE
#endif
#endif
#include <shlobj.h>

View file

@ -25,12 +25,7 @@
#include "backends/fs/abstract-fs.h"
#if defined(ARRAYSIZE)
#undef ARRAYSIZE
#endif
#include <windows.h>
// winnt.h defines ARRAYSIZE, but we want our own one...
#undef ARRAYSIZE
#ifdef _WIN32_WCE
#undef GetCurrentDirectory
#endif

View file

@ -29,8 +29,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
// winnt.h defines ARRAYSIZE, but we want our own one...
#undef ARRAYSIZE
#include "audio/musicplugin.h"
#include "audio/mpu401.h"

View file

@ -33,7 +33,6 @@
// "ARRAYSIZE" for example.
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
#include "backends/platform/sdl/win32/win32.h"
#include "backends/plugins/sdl/sdl-provider.h"

View file

@ -29,7 +29,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
void SdlWindow_Win32::setupIcon() {
HMODULE handle = GetModuleHandle(NULL);

View file

@ -27,7 +27,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
#include <shellapi.h>
#if defined(__GNUC__) && defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
// required for SHGFP_TYPE_CURRENT in shlobj.h

View file

@ -22,12 +22,8 @@
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
#if defined(ARRAYSIZE)
#undef ARRAYSIZE
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
#if defined(__GNUC__) && defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
// required for SHGFP_TYPE_CURRENT in shlobj.h
#define _WIN32_IE 0x500

View file

@ -55,9 +55,6 @@
#define _WIN32_WINNT _WIN32_WINNT_WIN7
#include <windows.h>
#if defined(ARRAYSIZE)
#undef ARRAYSIZE
#endif
#endif
#include <shlobj.h>

View file

@ -117,11 +117,6 @@
#endif
#if defined(ARRAYSIZE)
// VS2005beta2 introduces new stuff in winnt.h
#undef ARRAYSIZE
#endif
#endif
#if defined(__QNXNTO__)

View file

@ -23,8 +23,6 @@
#if defined(WIN32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
// winnt.h defines ARRAYSIZE, but we want our own one... - this is needed before including util.h
#undef ARRAYSIZE
#endif
#define TRANSLATIONS_DAT_VER 3

View file

@ -56,6 +56,10 @@ template<typename T> inline T CLIP(T v, T amin, T amax)
*/
template<typename T> inline void SWAP(T &a, T &b) { T tmp = a; a = b; b = tmp; }
#ifdef ARRAYSIZE
#undef ARRAYSIZE
#endif
/**
* Macro which determines the number of entries in a fixed size array.
*/

View file

@ -26,8 +26,6 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <direct.h>
// winnt.h defines ARRAYSIZE, but we want our own one...
#undef ARRAYSIZE
#endif
#include "engines/engine.h"