Fixup APIENTRY macro on Apple

The version of glut.h that ships on Mac OSX undefines the APIENTRY
macro.  APIENTRY is used on Windows builds to specify that GL
functions use the __stdcall calling convention, so it needs to be
defined to be the empty string on Mac OSX.  Previously this hasn't
been a problem because all of the GL function prototypes and typedefs
are finished by the time glut.h is included.  However, when we switch
to using piglit-dispatch instead of GLEW, there will be at least one
compilation unit (piglit-dispatch.c) which needs to use the APIENTRY
macro after including glut.h.

This patch works around the problem by redefining APIENTRY to the
correct value (which is the empty string) after including glut.h on
Apple builds.
1 file changed