Path: utzoo!attcan!uunet!mcsun!unido!gmdzi!wittig From: wittig@gmdzi.UUCP (Georg Wittig) Newsgroups: comp.lang.c Subject: Re: Nested Macros Message-ID: <1707@gmdzi.UUCP> Date: 21 Nov 89 08:17:21 GMT References: Organization: GMD - The German National Research Centre for Computer Science Lines: 18 jb3o+@andrew.cmu.edu (Jon Allen Boone) writes: >#define DEBUG 1 >#define DB(X) #ifdef (DEBUG) printf(X) >does anyone know how he would go about writing a macro that would >allow him to simply type DB(x) in his code and not have to type #ifdef >(DEBUG) printf(X) everywhere instead? #ifdef DEBUG # define DB(X) (printf(X)) #else # define DB(X) #endif -- Georg Wittig GMD-Z1.BI P.O. Box 1240 D-5205 St. Augustin 1 (West Germany) email: wittig@gmdzi.uucp phone: (+49 2241) 14-2294 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "Freedom's just another word for nothing left to lose" (Kris Kristofferson)