Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!mit-eddie!husc6!panda!genrad!decvax!tektronix!reed!omssw2!vrs From: vrs@omssw2.UUCP Newsgroups: comp.lang.c Subject: Re: pre#defines for system and machine (was: RMS comments to X3J11) Message-ID: <556@omssw2.UUCP> Date: Mon, 26-Jan-87 02:15:35 EST Article-I.D.: omssw2.556 Posted: Mon Jan 26 02:15:35 1987 Date-Received: Tue, 27-Jan-87 19:11:55 EST References: <2144@brl-adm.ARPA> <5497@brl-smoke.ARPA> <3952@utcsri.UUCP> Reply-To: vrs@omssw2.UUCP (Vincent R. Slyngstad) Organization: Intel Corp., OMS Div., Systems Group, Hillsboro, OR Lines: 34 Summary: pre#defines are the wrong way to go anyway In article <3952@utcsri.UUCP> flaps@utcsri (Alan J Rosenthal ) writes: >In article <5497@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn ) writes: >>For example, the machine I'm preparing this response on would >>predefine _sys_bsd43 and _mach_vax. > >Why _sys_bsd43 and not _sys_bsd but _mach_vax but not _mach_vax8600 (or >whatever)? I think there is entirely too much emphasis placed on high level symbols (like bsd) where low level symbols (like SIGTSTP) are needed. I often see code that reads #ifdef SYSV ioctl(fd, TCGETA, &term); #endif when it ought (in my opinion) to read #ifdef TCGETA ioctl(fd, TCGETA, &term); #endif so that the test is for the existence of the feature, not some implicit assumption about the features present in a particular system. I'm not familiar with 4.3, but I'd bet most of the features that distinguish it from 4.2 also define lower level symbols which could be checked for instead of _sys_bsd43. Similarly, I usually don't really care if it is a VAX -- I care about the word order or some other low level features. Making the code dependant on these low level feature defines improves portability immensely, because now I can run on any system with the feature (say TCGETA instead of only on a particular OS (SYSV). (If my system has job control, the code will use it, even if the OS isn't BSD). -- Vincent R. Slyngstad Xenix Evaluation Engineering Intel Corporation (omssw2!vrs) "I am not now, nor have I ever been, a gloom cookie." What episode of a popular TV show is the above line from?