Skip to content

Commit

Permalink
OPENGL: Added a temporary hack to fix compilation under Windows, afte…
Browse files Browse the repository at this point in the history
…r the latest changes to the SDL interface layer
  • Loading branch information
bluegr committed Aug 8, 2011
1 parent fd61a83 commit ef695cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backends/graphics/opengl/gltexture.h
Expand Up @@ -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)
Expand Down

0 comments on commit ef695cb

Please sign in to comment.