So, FTGL doesn’t build on Leopard/10.5. Strange, something in the API has changed… Arg. . Builds fine on Tiger/10.4. Turns out that now Apple uses the more UNIX-style of this GLvoid() function.
So Tiger/10.4 uses one and Leopard/10.5 uses another. How do I tell them apart when compiling? Hmm, well the best I could find is the value of __APPLE_CC__. It is set to the gcc build number. It seems that Apple always increments that number. Xcode 3.0 doesn’t run on Tiger. So I should be able to reliably test for the OS version depending on which version of the compiler is being used.
Here is a quite summary of the build numbers that I found:
10.4/Xcode gcc: 5370
10.5/XCode 3.0 gcc: 5465
10.5/XCode 3.1 gcc: 5470
10.5/XCode 3.1 gcc-4.2: 5553
So here’s the code that I used, it seems to work ok, anyone got a better idea?
#if defined(__APPLE_CC__) && __APPLE_CC__ < 5400
typedef GLvoid (*GLUTesselatorFunction)(...);
#elif defined( __mips ) || defined( __linux__ ) || defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __sun ) || defined (__CYGWIN__) || defined (__APPLE__)
typedef GLvoid (*GLUTesselatorFunction)();
#elif defined ( WIN32)
typedef GLvoid (CALLBACK *GLUTesselatorFunction)( );
#endif