home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8710 / 5 < prev    next >
Encoding:
Text File  |  1990-07-13  |  1.3 KB  |  50 lines

  1. Path: uunet!husc6!necntc!ncoast!allbery
  2. From: drw@culdev1.UUCP (Dale Worley)
  3. Newsgroups: comp.sources.misc
  4. Subject: scpp: small fix to processing of #define's
  5. Message-ID: <4812@ncoast.UUCP>
  6. Date: 5 Oct 87 00:40:51 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Organization: Cullinet Software, Westwood, MA, USA
  9. Lines: 37
  10. Approved: allbery@ncoast.UUCP
  11. X-Archive: comp.sources.misc/8710/5
  12.  
  13. scpp, as posted, doesn't understand that a #define inside a section of
  14. code that is #ifdef'ed out should be ignored.  This causes problems
  15. with files like:
  16. #ifdef FOO
  17.     #define _foo_ 1
  18. #else
  19.     #define _foo_ 0
  20. #endif
  21.  
  22. #if _foo_
  23. ...
  24. #endif
  25.  
  26. The following patch causes scpp to ignore a #define, if it is inside a
  27. false #if:
  28.  
  29. *** ctrl.c.old    Mon Sep 28 12:01:22 1987
  30. --- ctrl.c    Mon Sep 28 12:01:37 1987
  31. ***************
  32. *** 317,322 ****
  33. --- 317,326 ----
  34.                    */
  35.   
  36.   
  37. +     /* If we are in a false conditional, ignore the definition */
  38. +     if (falsecnt != 0)
  39. +         return endline();
  40.       /*
  41.        * scan for the macro name with identifier expansion turned off.
  42.        * Find the slot corresponding to the macro name.
  43.  
  44. -- 
  45. Dale Worley    Cullinet Software      ARPA: culdev1!drw@eddie.mit.edu
  46. UUCP: ...!seismo!harvard!mit-eddie!culdev1!drw
  47. "Thank you for your cooperation.  Goodnight." -- Robocop
  48. "Don't f--k with the babysitter." -- Adventures in Babysitting
  49.