Xref: utzoo comp.lang.c:11741 comp.os.vms:7868 Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!cwjcc!gatech!utkcs2!moore From: moore@utkcs2.cs.utk.edu (Keith Moore) Newsgroups: comp.lang.c,comp.os.vms Subject: Re: cpp compatiblity Unix/VMS Summary: #include "filename.h" works in VMS also Keywords: cpp #include VMS Message-ID: <452@utkcs2.cs.utk.edu> Date: 5 Aug 88 12:20:14 GMT References: <134@iquery.UUCP> Organization: University of Tennessee, Knoxville Lines: 46 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 > > 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? Sure. Just use #ifdef vms #include #include #else ... for VMS also. The VMS systems I have seen put copies of these files in sys$library:, and the C compiler knows to search for include files there. This may be an option, however. At worst, you can extract them from sys$library:vaxcdef.tlb with the LIBRARY command, as in: $ lib/extract=file sys$library:vaxcdef.tlb $ rename vaxcdef.txt file.h ...and use the #include "filename" syntax, or the /INCLUDE= command line qualifier. BTW, you might prefer to use #ifdef vms rather than #ifdef VAX. *Some* VAXen run a different operating system. :-) ...embarassed that I know this much about the VMS C compiler... Keith Moore UT Computer Science Dept. Internet/CSnet: moore@utkcs2.cs.utk.edu 107 Ayres Hall, UT Campus BITNET: moore@utkcs1 Knoxville Tennessee 37996-1301 Telephone: +1 615 974 0822 -- Keith Moore UT Computer Science Dept. Internet/CSnet: moore@utkcs2.cs.utk.edu 107 Ayres Hall, UT Campus BITNET: moore@utkcs1 Knoxville Tennessee 37996-1301 Telephone: +1 615 974 0822