diff --git a/backends/audiocd/win32/win32-audiocd.cpp b/backends/audiocd/win32/win32-audiocd.cpp index 72699105061..9ffcc00ec3a 100644 --- a/backends/audiocd/win32/win32-audiocd.cpp +++ b/backends/audiocd/win32/win32-audiocd.cpp @@ -46,7 +46,6 @@ #define WIN32_LEAN_AND_MEAN #include -#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one... #include "backends/audiocd/win32/win32-audiocd.h" diff --git a/backends/dialogs/win32/win32-dialogs.cpp b/backends/dialogs/win32/win32-dialogs.cpp index e34a08c07b2..fca0601a71a 100644 --- a/backends/dialogs/win32/win32-dialogs.cpp +++ b/backends/dialogs/win32/win32-dialogs.cpp @@ -56,9 +56,6 @@ #define WIN32_LEAN_AND_MEAN #include -#if defined(ARRAYSIZE) -#undef ARRAYSIZE -#endif #endif #include diff --git a/backends/fs/windows/windows-fs.h b/backends/fs/windows/windows-fs.h index 3758877f05e..4be4cbf57e1 100644 --- a/backends/fs/windows/windows-fs.h +++ b/backends/fs/windows/windows-fs.h @@ -25,12 +25,7 @@ #include "backends/fs/abstract-fs.h" -#if defined(ARRAYSIZE) -#undef ARRAYSIZE -#endif #include -// winnt.h defines ARRAYSIZE, but we want our own one... -#undef ARRAYSIZE #ifdef _WIN32_WCE #undef GetCurrentDirectory #endif diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp index 52a46200cb4..35608fd228f 100644 --- a/backends/midi/windows.cpp +++ b/backends/midi/windows.cpp @@ -29,8 +29,6 @@ #define WIN32_LEAN_AND_MEAN #include -// winnt.h defines ARRAYSIZE, but we want our own one... -#undef ARRAYSIZE #include "audio/musicplugin.h" #include "audio/mpu401.h" diff --git a/backends/platform/sdl/win32/win32-main.cpp b/backends/platform/sdl/win32/win32-main.cpp index 4e9f6a49da7..0a7c1dd8e2d 100644 --- a/backends/platform/sdl/win32/win32-main.cpp +++ b/backends/platform/sdl/win32/win32-main.cpp @@ -33,7 +33,6 @@ // "ARRAYSIZE" for example. #define WIN32_LEAN_AND_MEAN #include -#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" diff --git a/backends/platform/sdl/win32/win32-window.cpp b/backends/platform/sdl/win32/win32-window.cpp index 8c01da0e366..47d77a8ad11 100644 --- a/backends/platform/sdl/win32/win32-window.cpp +++ b/backends/platform/sdl/win32/win32-window.cpp @@ -29,7 +29,6 @@ #define WIN32_LEAN_AND_MEAN #include -#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one... void SdlWindow_Win32::setupIcon() { HMODULE handle = GetModuleHandle(NULL); diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 264a0640edb..e837bbae034 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -27,7 +27,6 @@ #define WIN32_LEAN_AND_MEAN #include -#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one... #include #if defined(__GNUC__) && defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) // required for SHGFP_TYPE_CURRENT in shlobj.h diff --git a/backends/saves/windows/windows-saves.cpp b/backends/saves/windows/windows-saves.cpp index fec4828725a..50564e974db 100644 --- a/backends/saves/windows/windows-saves.cpp +++ b/backends/saves/windows/windows-saves.cpp @@ -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 -#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 diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index f6706de72d0..1a03bbd5169 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -55,9 +55,6 @@ #define _WIN32_WINNT _WIN32_WINNT_WIN7 #include - #if defined(ARRAYSIZE) - #undef ARRAYSIZE - #endif #endif #include diff --git a/common/scummsys.h b/common/scummsys.h index 3b22272b5ae..b2056656539 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -117,11 +117,6 @@ #endif - #if defined(ARRAYSIZE) - // VS2005beta2 introduces new stuff in winnt.h - #undef ARRAYSIZE - #endif - #endif #if defined(__QNXNTO__) diff --git a/common/translation.cpp b/common/translation.cpp index 35e5b6e4c3d..1debabfb7d8 100644 --- a/common/translation.cpp +++ b/common/translation.cpp @@ -23,8 +23,6 @@ #if defined(WIN32) #define WIN32_LEAN_AND_MEAN #include -// 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 diff --git a/common/util.h b/common/util.h index 2d6a36d0868..77d7523034d 100644 --- a/common/util.h +++ b/common/util.h @@ -56,6 +56,10 @@ template inline T CLIP(T v, T amin, T amax) */ template 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. */ diff --git a/engines/engine.cpp b/engines/engine.cpp index cc8c0132f9a..0e7f64f8a4c 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -26,8 +26,6 @@ #define WIN32_LEAN_AND_MEAN #include #include -// winnt.h defines ARRAYSIZE, but we want our own one... -#undef ARRAYSIZE #endif #include "engines/engine.h"