#ifndef __SG_EXTENSIONS_HXX
#define __SG_EXTENSIONS_HXX 1
-#if defined(__CYGWIN__) /* && !defined(USING_X) */
+#if defined(__CYGWIN__) && !defined(WIN32) /* && !defined(USING_X) */
#define WIN32
#endif
# include <dlfcn.h>
#endif
-#include <GL/gl.h>
+#include <simgear/compiler.h>
+
+#include SG_GL_H
#if defined(__cplusplus)
// don't use an inline function for symbol lookup, since it is too big
void* macosxGetGLProcAddress(const char *func);
-#else if !defined( WIN32 )
+#elif !defined( WIN32 )
void *SGGetGLProcAddress(const char *func);