Preprocessor variable for detecting platform

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am producing some multiple platform code which does have some platform
dependent items that I would like to conditionally compile in. The
question is, how do I determine what the appropriate preprocessor
variable that would indicate for example, being on a Linux platform vs
an AIX platform.

For example there are some socket options that are platform specific, so
I would like to have code that looks like :

#if defined(_AIX_)
	int option = TCP_NODELAYACK;
#else if defined(_LINUX_)
	int option = TCP_QUICKACK;
#else
#error Unsupported platform, please determine proper option and update
code.
#endif

Thanks,
Dale Pennington


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux