aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorFilippos Karapetis2011-08-09 02:24:59 +0300
committerFilippos Karapetis2011-08-09 02:24:59 +0300
commitef695cb7dd17aaa24378c834a5ba5d78e6093792 (patch)
tree1c6021793bf4b3a227606272848b9600f845f487 /backends
parentfd61a83bb52febb2d620d858d6685c8232251105 (diff)
downloadscummvm-rg350-ef695cb7dd17aaa24378c834a5ba5d78e6093792.tar.gz
scummvm-rg350-ef695cb7dd17aaa24378c834a5ba5d78e6093792.tar.bz2
scummvm-rg350-ef695cb7dd17aaa24378c834a5ba5d78e6093792.zip
OPENGL: Added a temporary hack to fix compilation under Windows, after the latest changes to the SDL interface layer
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/opengl/gltexture.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/backends/graphics/opengl/gltexture.h b/backends/graphics/opengl/gltexture.h
index f0cd7aed56..3e04949c8c 100644
--- a/backends/graphics/opengl/gltexture.h
+++ b/backends/graphics/opengl/gltexture.h
@@ -31,6 +31,16 @@
#undef ARRAYSIZE
#endif
+// HACK: At this point in Windows platforms, common/util.h has been included
+// via common/rect.h (from backends/graphics/sdl/sdl-graphics.h), via
+// backends/graphics/openglsdl/openglsdl-graphics.h. Thus, we end up with
+// COMMON_UTIL_H defined, and ARRAYSIZE undefined (bad!). Therefore,
+// ARRAYSIZE is undefined in openglsdl-graphics.cpp. This is a temporary
+// hackish solution fo fix compilation under Windows.
+#if !defined(ARRAYSIZE) && defined(COMMON_UTIL_H)
+#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
+#endif
+
#if defined(USE_GLES)
#include <GLES/gl.h>
#elif defined(SDL_BACKEND)