This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Preprocessor variable for detecting platform
- From: "John (Eljay) Love-Jensen" <eljay at adobe dot com>
- To: "EXT-Pennington, Dale K" <dale dot k dot pennington at boeing dot com>, "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 5 Mar 2009 07:56:09 -0800
- Subject: RE: Preprocessor variable for detecting platform
- References: <1CC457B32B272941A4676243F4F87DCD046696B7@XCH-SEEXT-10.se.nos.boeing.com>
Hi Dale,
> how do I determine what the appropriate preprocessor
variable that would indicate for example, being on a Linux platform vs
an AIX platform.
Refer to the GCC documentation for that platform, man gcc
Use this trick to view the predefined preprocessor identifiers
echo '' | gcc -E -dM -x c - | sort
Hopefully the relevant one is obvious. (Sometimes there are a few that look appropriate, which requires a little more documentation diving investigation.)
HTH,
--Eljay