penneyj@servio.UUCP (D. Jason Penney) (10/26/89)
We have some code that is heavily ported (over half a dozen systems). One of our tricks is to recognize pre-defined preprocessor symbols and to use those to indicate the given hardware/os platform that the code is running on. A few examples might suffice: VMS -- DEC VAX/VMS (Note: SYS$GETSYI can subsequently return much more specific info) sun -- Sun Microsystems mc68020 -- Sun-3 sparc -- Sun-4 sun386 -- Sun 386i RoadRunner ultrix -- DEC Ultrix mips -- DECstation vax -- VAXstation sony_news -- Sony NEWS workstation ... and so forth. You get the idea. The problem arises with AIX. "AIX" will define the operating system directly, but how do I distinguish 370, RT, and (soon to be available) RIOS architectures? Please reply by e-mail, and I will post a summary if warranted. Thanks in advance. -- D. Jason Penney Ph: (503) 629-8383 Beaverton, OR 97006 uucp: ...uunet!servio!penneyj STANDARD DISCLAIMER: Should I or my opinions be caught or killed, the company will disavow any knowledge of my actions...