diff options
Diffstat (limited to 'backends/graphics/opengl/gltexture.h')
-rw-r--r-- | backends/graphics/opengl/gltexture.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/backends/graphics/opengl/gltexture.h b/backends/graphics/opengl/gltexture.h index f0cd7aed56..2f0bef2bbf 100644 --- a/backends/graphics/opengl/gltexture.h +++ b/backends/graphics/opengl/gltexture.h @@ -20,6 +20,9 @@ * */ +#ifndef BACKENDS_GRAPHICS_OPENGL_GLTEXTURE_H +#define BACKENDS_GRAPHICS_OPENGL_GLTEXTURE_H + #include "common/scummsys.h" #ifdef WIN32 @@ -31,6 +34,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) @@ -106,3 +119,5 @@ protected: GLint _filter; bool _refresh; }; + +#endif |