Dav1dde / glad

Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.
https://glad.dav1d.de/
Other
3.79k stars 448 forks source link

Issues with `MemoryBarrier` conflicting with winnt.h macros #388

Closed haasn closed 2 years ago

haasn commented 2 years ago

When using --mx the GladGLContext contains a struct member called just MemoryBarrier, from glMemoryBarrier.

This conflicts with the MemoryBarrier macro defined in <winnt.h>, leading to compilation issues in some cases.

It might be possible to work-around this on my end but I fear that the <winapifamily.h> import inside glad pulls this symbol in. I'll investigate.

haasn commented 2 years ago

Oh, actually, I think the trick is to #undef it before importing glad/gl.h, not after, as I was currently doing. That seems to have worked around it. :shrug: