From d0512db25ce5bbd8f31151c3d2374f344f77f006 Mon Sep 17 00:00:00 2001 From: SupSuper Date: Sun, 16 Dec 2018 21:56:19 +0000 Subject: 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 --- common/scummsys.h | 5 ----- common/translation.cpp | 2 -- common/util.h | 4 ++++ 3 files changed, 4 insertions(+), 7 deletions(-) (limited to 'common') diff --git a/common/scummsys.h b/common/scummsys.h index 3b22272b5a..b205665653 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 35e5b6e4c3..1debabfb7d 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 2d6a36d086..77d7523034 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. */ -- cgit v1.2.3