thomson@vms.macc.wisc.edu (Don Thomson, MACC) (11/20/90)
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? ----- Don Thomson ----- MACC, 1210 W. Dayton, Madison, WI 53706 ------------- (608) 262-0138 thomson@macc.wisc.edu / thomson@wiscmacc.bitnet
bad@atrain.sw.stratus.com (Bruce Dumes) (11/21/90)
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?" |