Xref: utzoo comp.lang.c:11735 comp.os.vms:7856 Path: utzoo!attcan!uunet!mcvax!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.lang.c,comp.os.vms Subject: Re: cpp compatiblity Unix/VMS Keywords: cpp #include VMS Message-ID: <575@philmds.UUCP> Date: 6 Aug 88 11:04:32 GMT References: <134@iquery.UUCP> Reply-To: leo@philmds.UUCP (Leo de Wit) Organization: Philips I&E DTS Eindhoven Lines: 38 In article <134@iquery.UUCP> matt@iquery.UUCP (Matt Reedy) writes: >We had a discussion a few months ago about the [in]compatiblity of the >System V.3 cpp and VMS #include syntax, but I forgot the outcome :^). > >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 > >On the VAX, the '#include file' and '#include stdio' syntax is valid and >references members of a text library. However, my 3B2 cpp chokes on these >lines with 'bad include syntax' even though the symbol VAX is NOT DEFINED. > >Is there an easy workaround? Yes, there is. Change it into: #include #ifdef VAX #include #else #include #endif The files stdio.h and file.h should reside in the directory SYS$LIBRARY, as should the other standard include files. (Don't know about text libraries, but I would not use them if they insisted on such a weird syntax, invoking all kinds of portability problems). Leo.