Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

preprocessor directive to determine OS?



Hi all,

I have a fairly simple question. I'm writing a C/C++ application and want to make it cross-platform, so it will include different modules for different operating systems. The first target system is OS X 10.2 or higher, with an eventual port to Win32. Can someone tell me, what are the macros used by OS X to indicate the OS name and version? For example, to have system-specific code I would do something like this:

#if defined MAC_OS_X
// OS X specific code
#elif defined WINDOWS
//windows specific code
#elif defined SOME_OTHER_OS
//some other code
...
...

Well you get the picture. Anyway, I need to know what macros to put in instead of my fake "MAC_OS_X" and "WINDOWS" macros. Thanks a lot.

Ilya Maykov
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.