home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!husc6!necntc!ncoast!allbery
- From: drw@culdev1.UUCP (Dale Worley)
- Newsgroups: comp.sources.misc
- Subject: scpp: small fix to processing of #define's
- Message-ID: <4812@ncoast.UUCP>
- Date: 5 Oct 87 00:40:51 GMT
- Sender: allbery@ncoast.UUCP
- Organization: Cullinet Software, Westwood, MA, USA
- Lines: 37
- Approved: allbery@ncoast.UUCP
- X-Archive: comp.sources.misc/8710/5
-
- scpp, as posted, doesn't understand that a #define inside a section of
- code that is #ifdef'ed out should be ignored. This causes problems
- with files like:
- #ifdef FOO
- #define _foo_ 1
- #else
- #define _foo_ 0
- #endif
-
- #if _foo_
- ...
- #endif
-
- The following patch causes scpp to ignore a #define, if it is inside a
- false #if:
-
- *** ctrl.c.old Mon Sep 28 12:01:22 1987
- --- ctrl.c Mon Sep 28 12:01:37 1987
- ***************
- *** 317,322 ****
- --- 317,326 ----
- */
-
-
- + /* If we are in a false conditional, ignore the definition */
- + if (falsecnt != 0)
- + return endline();
- +
- /*
- * scan for the macro name with identifier expansion turned off.
- * Find the slot corresponding to the macro name.
-
- --
- Dale Worley Cullinet Software ARPA: culdev1!drw@eddie.mit.edu
- UUCP: ...!seismo!harvard!mit-eddie!culdev1!drw
- "Thank you for your cooperation. Goodnight." -- Robocop
- "Don't f--k with the babysitter." -- Adventures in Babysitting
-