Skip to content

glut_wrapper: fix macos glut/glad compatibility

Erik Faye-Lund requested to merge kusma/mesa-demos:macos-glut-fix into main

When a source-file includes the glad-header, the glad header defines APIENTRY to nothing, and defines GLAPIENTRY to APIENTRY. So far so good.

But when they then include macOS' glut.h afterwads, glut.h ends up undefining APIENTRY, meaning GLAPIENTRY now expands to the identifier APIENTRY, not the variable as it used to.

In order to patch over that problem, let's define APIENTRY back to nothing, so things expand the way we want it. This should be safe, because this only happend on macOS, and only when not using FreeGLUT, which doesn't have the same problem.

Closes: #24 (closed)

Merge request reports