Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!PT.CS.CMU.EDU!IUS1.CS.CMU.EDU!edw From: edw@IUS1.CS.CMU.EDU.UUCP Newsgroups: comp.lang.c Subject: Re: How can I use #define to make something completely disappear? Message-ID: <263@PT.CS.CMU.EDU> Date: Sat, 31-Oct-87 09:54:54 EST Article-I.D.: PT.263 Posted: Sat Oct 31 09:54:54 1987 Date-Received: Mon, 2-Nov-87 07:10:27 EST References: <10083@brl-adm.ARPA> Sender: netnews@PT.CS.CMU.EDU Organization: Carnegie-Mellon University, CS/RI Lines: 27 In article <10083@brl-adm.ARPA>, ultra!wayne@ames.arpa (Wayne Hathaway) writes: [A lot of stuff about how do I write a macro that allows the option to include or not to include code depending on whether a switch is defined] Heres what I do: #ifdef DEBUG #define if_debug(x) x #else #define if_debug(x) #endif if_debug( printf("XYZ entry, p1=%x, p2=%x\n", p1, p2) ); BTW: Are the macros __FILE__ and __LINE__ define for all C compilers?? -- Eddie Wyatt e-mail: edw@ius1.cs.cmu.edu