Xref: utzoo comp.lang.c:11773 comp.os.vms:7911 Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!ucbvax!decwrl!hplabs!cae780!leadsv!laic!nova!darin From: darin@nova.laic.uucp (Darin Johnson) Newsgroups: comp.lang.c,comp.os.vms Subject: Re: cpp compatiblity Unix/VMS Keywords: cpp #include VMS Message-ID: <318@laic.UUCP> Date: 8 Aug 88 19:42:04 GMT References: <134@iquery.UUCP> Sender: news@laic.UUCP Lines: 45 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 > I wonder why DEC likes to push this format. Obviously, it is not clear enough in the C manual that the following are EQUIVALENT! #include stdio and #include I have all my VMS software using the angle-brackets with absolutely no problem. Leaving the brackets off speeds up access by a miniscule fraction. I feel this is a serious documentation problem with DECs C manual. None of the examples in the manual use the angle brackets, which is probably why I see so many people with the impression that they aren't allowed. So I would change the code above to read: #ifdef VMS #include #else #include #endif #include (notice that I have #ifdef VMS instead of #ifdef VAX!) Also, if you define the logical name SYS to point to SYS$LIBRARY, then you can also have statements like "#include ", which makes for easier porting. Darin Johnson (...pyramid.arpa!leadsv!laic!darin) (...ucbvax!sun!sunncal!leadsv!laic!darin) "All aboard the DOOMED express!"