Path: utzoo!mnetor!uunet!steinmetz!davidsen From: davidsen@steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.lang.c Subject: Fancy preprocessor stuff Message-ID: <10767@steinmetz.ge.com> Date: 10 May 88 13:44:15 GMT Organization: GE Corp. R & D, Schenectady,NY Lines: 25 Keywords: SCCS, preprocessor Here's a question for the preprocessor guru in you: I have a program which has it's source in SCCS. I want to take some action if the compiled source is a non-production version (extracted from the SCCS base with -e, keywords not expanded). I know how to do this easily at runtime, but what I really want is the do it in the preprocessor. Here's what I do at runtime: flag = atoi("%R%"); if (flag) { /* productions version */ } else { /* development version */ } I suspect that there's a neat way to avoid generating all that code, and doing the test in inner loops. Here's your chance to show how well you understand the preprocessor. One last restriction: must be portable and ANSI compliant, valid in (at least) BSD, SysV, VMS and MSC. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me