skaslev / gl3w

Simple OpenGL core profile loading
http://github.com/skaslev/gl3w
The Unlicense
709 stars 160 forks source link

Fix WIN32_LEAN_AND_MEAN redefinition #63

Closed kotauskas closed 5 years ago

kotauskas commented 5 years ago

I encountered this little issue because I included gl3w.c as a header in the very end of gl3w.h because Visual Studio wanted every single .c/.cpp file to include my precompiled header. Since I included gl3w.h after including Windows.h (I define WIN32_LEAN_AND_MEAN), I got a macro redefinition. Most libraries do this - I was surprised that gl3w didn't. Here's a patch for the generator to add the #ifdef guard to the #define WIN32_LEAN_AND_MEAN.