Xref: utzoo comp.lang.c:11726 comp.os.vms:7833 Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!cornell!uw-beaver!teknowledge-vaxc!sri-unix!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.c,comp.os.vms Subject: Re: cpp compatiblity Unix/VMS Keywords: cpp #include VMS Message-ID: <252@quintus.UUCP> Date: 5 Aug 88 20:13:36 GMT References: <134@iquery.UUCP> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 36 In article <134@iquery.UUCP> matt@iquery.UUCP (Matt Reedy) writes: >The problem is the following: I want the same source to compile on both >SysV and VMS, so I use this style: >#ifdef VAX >#include file >#include stdio >#else >#include >#include >#endif >[V.3 cpp dislikes the first two #includes] (1) That should be #ifdef vms, not #ifdef VAX. VAXen run 4.?BSD, Ultrix, and some flavour of System V, as well as VMS. (2) While #include stdio and #include do mean different things in VAX-11 C (check the manual) the latter form _is_ accepted and will work unless you've gone out of your way to break it. You should be able to convert to #ifdef vms #include #include #else #include #include #endif and have it work on both. (We had to do this for quite a lot of files; what makes it particularly galling is that the vms #includes caused no trouble in V.2. Sometimes I wonder about AT&T.) (3) Another possibility is to use some other preprocessor. For example, stuff your program through the GNU "C Compatible Compiler Preprocessor (CCCP)", and give the result to AT&T's compiler.