Does SDL_opengl.h need to include windows.h?

I had a (relatively minor) issue with my SDL project where my autocomplete menu was filled with options from Windows API files all over the place. We weren’t including windows.h anywhere, so we did some hunting and found it included in SDL_opengl.h. Interestingly, when we commented that out as an experiment, everything built just fine and our auto-complete lists were much more manageable as a result. Is there any reason that include needs to be there anymore or can it be taken out? It seems like it would be less bloat.

At any rate, we’ll be leaving it out of our project unless it begins to cause us problems.

I know that on Visual Studio, including gl/gl.h requires also
including windows.h for some reason. On MinGW(-w64) this isn’t the
case and it can be left out.

No idea how this applies to SDL_opengl.h but I wouldn’t be surprised
if there’s a similar issue.

2015-01-27 21:02 GMT-03:00, jasonericson :> I had a (relatively minor) issue with my SDL project where my autocomplete

menu was filled with options from Windows API files all over the place. We
weren’t including windows.h anywhere, so we did some hunting and found it
included in SDL_opengl.h. Interestingly, when we commented that out as an
experiment, everything built just fine and our auto-complete lists were much
more manageable as a result. Is there any reason that include needs to be
there anymore or can it be taken out? It seems like it would be less bloat.

At any rate, we’ll be leaving it out of our project unless it begins to
cause us problems.

It’s used for APIENTRY, which is defined as __stdcall if ((_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)). Even though on ARM __stdcall is ignored, I think it would be better to keep including Windows.h to avoid possible problems in the future.