Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!wuarchive!emory!att!bu.edu!transfer!lectroid!atrain!bad From: bad@atrain.sw.stratus.com (Bruce Dumes) Newsgroups: comp.lang.c Subject: Re: Preprocessing #ifdef but not #define Message-ID: <3191@lectroid.sw.stratus.com> Date: 21 Nov 90 13:31:15 GMT References: <4769@dogie.macc.wisc.edu> Sender: usenet@lectroid.sw.stratus.com Distribution: usa Organization: Stratus Computer, Inc. Lines: 23 In article <4769@dogie.macc.wisc.edu> thomson@vms.macc.wisc.edu (Don Thomson, MACC) writes: >I'm sorting through C code loaded with #ifdef statements for portability. I'd >like to strip the code down to a version that applies to my operating system >and configuration so that I can read through it but don't want to preprocess >all the #define statements, as I'd like to see the #define mnemonics in the >stripped down code. I don't see any options for the C preprocessor that will >allow me to preprocess #ifdef's but not #define's. Is there an easy way to do >this? > If you have Gnu emacs, you can use the hide-ifdefs command. It's pretty handy. You can define whatever you want, and all the undefined "#ifdef"s will look something like: #ifdef FOOBAR ... #else printf("I am not a foobar\n"); #endif -- Bruce Dumes | "You don't see many of *these* nowdays, | bad@zen.cac.stratus.com | do you?" |