Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!bellcore!mrevox!judah From: judah@mrevox.UUCP Newsgroups: comp.lang.c Subject: Re: pre#defines for system and machine Message-ID: <42200002@mrevox.UUCP> Date: Thu, 29-Jan-87 08:55:00 EST Article-I.D.: mrevox.42200002 Posted: Thu Jan 29 08:55:00 1987 Date-Received: Fri, 30-Jan-87 05:45:11 EST References: <5573@brl-smoke.UUCP> Organization: Bell Communications Research, Inc. Lines: 40 Nf-ID: #R:brl-smoke:-557300:mrevox:42200002:000:1890 Nf-From: mrevox!judah Jan 29 08:55:00 1987 While reading through the documentation of the "new make" from the AT&T toolchest, I find that it comes with a modified version of "cpp" which seems to address all the comments about "#defines" mentioned in the latest string of notes. To quote parts of the paper "The Fourth Generation Make" by Glenn S. Fowler: " ... The version of _cpp_ distributed with the _new_make_ also contains some changes that improve makefile portability. "#if" statements may use the following builtin tests: exists(file) - Returns 1 if _file_ can be found using the #include search rules. ... ... Additional function predicates are defined by "#assert" statements in the include file which is automatically included by _cpp_ before the first input file is read. "#assert _predicate_(_value_)" makes assertions that can be tested in "#if" expressions. Such assertions are only recognized within "#if" expressions and do not conflict with "#define" variable expansions. Most assertions deal with the current machine environment: system(_system-name_) Defines the operating system name. Example values for _system-name_ are "unix" and "gcos". release(_system-release_) Defines the operating system release name. Example values for _system-release_ are "apollo", "bsd", ... ... " These extensions to CPP would allow any level of specification of the parentage of an operating system without having to resort to "_sys_unix_sysV_5_0_" or other such monstrosities. I am no expert on the fine points of C, but this proposal also looks upwardly compatible with existing usage. Anyone in a position to do so willing to propose this to the ANSI C committee? (Or is the idea copyright by AT&T??) Judah Greenblatt, Bell Communications Research, Morristown, NJ, USA (201)829-3059, judah@flash.bellcore.com, ...!bellcore!flash!judah P.S. Any other votes for adding "#elseif" to _cpp_??