Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!talcott!necntc!frog!john From: john@frog.UUCP (John Woods, Software) Newsgroups: net.lang.c Subject: Re: Disappearing function call Message-ID: <1077@frog.UUCP> Date: Tue, 7-Oct-86 15:43:33 EDT Article-I.D.: frog.1077 Posted: Tue Oct 7 15:43:33 1986 Date-Received: Wed, 8-Oct-86 08:28:11 EDT References: <357@cullvax.UUCP> Organization: Superfrog Heaven [ CRDS, Framingham MA ] Lines: 27 > What I want to do is to write a function call of a variable number of > arguments: > debug(x, y, z, ...) > that will generate no code when the symbol DEBUG is not defined, but > generate a call of some function (say, debug_()) when it is. Try: #ifdef DEBUG #define debug(x) x #else #define debug(x) #endif debug( puts("Shut 'er down, Scotty, she's sucking mud again."); ) The extra layer of indirection may feel irritating, but it also allows debug( if (op == NULL) exit(puts("RATS RATS RATS [#566, para. 1]")); ) It's quick, it's easy, it works. -- John Woods, Charles River Data Systems, Framingham MA, (617) 626-1101 ...!decvax!frog!john, ...!mit-eddie!jfw, jfw%mit-ccc@MIT-XX.ARPA "Don't give me this intelligent life crap, just find me a planet I can blow up."