Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!panews.awdpa.ibm.com!!jsalter From: jsalter@slo Newsgroups: comp.unix.aix Subject: Re: #defines for AIX versions & h/w architectures Message-ID: <1990Oct10.011457.27986@panews> Date: 10 Oct 90 01:14:57 GMT References: <1204@ucl-cs.UUCP> Sender: news@panews (news id) Reply-To: jsalter@slo.UUCP (Jim Salter) Organization: IBM AWD Development, Palo Alto Lines: 47 >From: Jon Crowcroft >what predefineds (e.g. is cpp called with any by cc) >exist for writing sensible >#ifdef >to make code conditionally portable over AIX >on PS/2, RS6000 and aix370 on a 3090? For AIX PS/2 (/etc/cc.cfg), AIX/370 (man cc.cfg) and AIX v3.1 6000 (/etc/xlc.cfg), the following define exists across all platforms: _AIX To indicate differences between them, AIX PS/2 defines (/etc/cc.cfg): _I386 AIX/370 defines (according to: man cc.cfg): u370 and the 6000 defines (/etc/xlc.cfg): _IBMR2 Thus, you can tell the different AIX versions apart by the defines. >(or does some sensible standard system header have a #define...?) Well, on the 6000 the attempt at satisfying lots of standards has occured making the header files full of #ifdefs as this has the least impact on the system. The common standards required are in the header file: /usr/include/standards.h In AIX/PS2, /etc/cc.cfg contains a line for the posix standard which should help with compilation to that standard. There are also flags for ANSI compliance for both the 6000 XL C compiler and AIX/370 (man cc). (Yes, I know this isn't the answer you were looking for, I just thought I'd clarify a few things.) >jon jim/jsalter IBM AWD, Palo Alto T465/(415)855-4427 VNET: JSALTER at AUSVMQ Internet: ibmsupt!jsalter@uunet.uu.net UUCP: ..!uunet!ibmsupt!jsalter "Waco is a state of mind. Once you've gone there, you never come back" - Leo