hughperman / pure-lang

Automatically exported from code.google.com/p/pure-lang
0 stars 0 forks source link

pure-gl missing #define for APIENTRY on OSX #45

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
As reported by autotelicum in issue #44:

System: Mac OS X 10.6.4, XCode 3.2.2 64-bit, gcc 4.2.1

In the the pure-gl GL*.c files APIENTRY is for non-windows systems defined at 
the beginning of each file.

After inclusion of glut.h the symbol is no longer defined because in glut.h:
...
#if !defined(_WIN32)
#define APIENTRY
#define GLUT_APIENTRY_DEFINED
#define CALLBACK
#endif
...
#ifdef GLUT_APIENTRY_DEFINED
# undef GLUT_APIENTRY_DEFINED
# undef APIENTRY
#endif
...

So redefining APIENTRY after the inclusion of glut.h is required to compile 
pure-gl with this version of glut on Mac OS X (I did not find a version number 
in the header files, so it is unclear to me which version of glut it really is 
that is included in the Apple tools).

[Add: comparing glut.h files it seems the latest is 3.7.6 from 2001 which is 
the one used in Mac OS X. Freeglut does not use the same defines, which may 
explain why it is not a problem on Linux.]

Original issue reported on code.google.com by aggraef@gmail.com on 2 Aug 2010 at 6:34

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 4053f57d71.

Original comment by aggraef@gmail.com on 12 Nov 2010 at 11:01