From: Steven M. Schweda [sms@antinode.org] Sent: Thursday, November 09, 2006 7:48 AM To: Info-VAX@Mvb.Saic.Com Subject: Re: XV 3.10a build on Alpha comments From: huber@NIRWANA-mppmu.mpg.de (Joseph Huber) > > In article <5722d$4552fc15$cef8887a$26819@TEKSAVVY.COM>, JF Mezei writes: > > I managed to build XV on my alpha (DECC 7.1 VMS 8.3) > > [...] > > VMS.C : > > -------------- > > int lstat(f,st) /* fake a stat operation to return file type */ > > [...] > > So I added an "#IFDEF __VAX" before the function and #ENDIF at the end. It > > then compiled fine since the compiler ignored the fake definition and used > > the one in the CRTL. It works with an upper-case "#ifdef"? Amazing. Not portable, but interesting. > I think it's not a VAX vs. Alpha questions, but a CRTL/VMS version question: > #if __VMS_VER < 70000000 > probably is the correct conditional. I'd say probably not. My STAT.H says: [...] # if !defined(__VAX) && __CRTL_VER >= 70301000 # define lstat(__p1,__p2) __utc_lstat(__p1,__p2) # endif [...] # if !defined(__VAX) && __CRTL_VER >= 70301000 int lstat (const char *__path, struct stat *__buf); # endif [...] # if !defined(__VAX) && __CRTL_VER >= 70301000 int lstat (const char *__path, struct stat *__buf, ...); # endif [...] so I'd vote for that (or its inverse, as appropriate) as the condition to use. In general, I've found that studying the header files for this sort of thing often works better than guessing at the conditions to use. It took me a while, but I've come around. (From time to time, I have needed to add something like "!defined(__VAX)", but the "__CRTL_VER" tests seem to be good.) ------------------------------------------------------------------------ Steven M. Schweda sms@antinode-org 382 South Warwick Street (+1) 651-699-9818 Saint Paul MN 55105-2547