diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c index 938b6e7c4a3..cf057430928 100644 --- a/src/mesa/main/errors.c +++ b/src/mesa/main/errors.c @@ -41,6 +41,9 @@ #if DETECT_OS_ANDROID # include #endif +#if DETECT_OS_WINDOWS +# include +#endif static FILE *LogFile = NULL; diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index cf17f1ecd50..bf24f6f30d0 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -34,8 +34,19 @@ #define GL_GLEXT_PROTOTYPES +#if defined(_WIN32) && !defined(__CYGWIN__) +/* Prevent glheader.h from including by defining APIENTRY */ +#pragma push_macro("APIENTRY") +#ifndef APIENTRY +#define APIENTRY GLAPIENTRY +#endif #include "GL/gl.h" #include "GL/glext.h" +#pragma pop_macro("APIENTRY") +#else /* !(defined(_WIN32) && !defined(__CYGWIN__)) */ +#include "GL/gl.h" +#include "GL/glext.h" +#endif /* defined(_WIN32) && !defined(__CYGWIN__) */ #ifdef __cplusplus