I've recently purchased a Mac in order to get some experience developing for a third platform, in addition to Windows and Linux. To start with I'm simply trying to port a couple of my existing programs, and a question has come up that I can't seem to find a solution to. In the past, I've been able to have certain parts of my code only compile for certain OSes by using #ifdef commands. For example:
#ifdef _WIN32
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){
#else
int main(){
#endif
However, I've been unable to identify an equivalent condition that can be used for identifying Mac OS X. This presents difficulties as a result of a few differences, like the fact the OpenGL headers are in a different path, OpenGL, instead of GL. I'd like to be able to do something like:
#ifdef _MAC_OS
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
It's occurred to me because of its UNIX heritage it may not actually be possible, in which case I'd most likely have to turn to a tool like autoconf or something instead. Still, I'd appreciate any advice that would let me keep my source consistent and compiling regardless of the platform.
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig