Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!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: Sun, 4-Oct-87 20:40:51 EDT Article-I.D.: ncoast.4812 Posted: Sun Oct 4 20:40:51 1987 Date-Received: Thu, 8-Oct-87 02:56:08 EDT 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