Article View: net.lang.c
Article #9553Re: Disappearing function call
From: Guido van Rossum
Date: Sat, 11 Oct 1986 12:30
Date: Sat, 11 Oct 1986 12:30
25 lines
1227 bytes
1227 bytes
In article <357@cullvax.UUCP> drw@cullvax.UUCP (Dale Worley) writes: >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. If >Is there a good way to do this? If you are willing to write extra parentheses but want them to match, write this: #ifdef DEBUG #define debug(x) debug_ x #else #define debug(x) /* empty */ #endif and call as follows: debug((x, y, z, ...)); -- Guido van Rossum, CWI, Amsterdam <guido@mcvax.uucp>
Technical Details
Message-ID:
<7098@boring.mcvax.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!rutgers!seismo!mcvax!guidoReferences:
<357@cullvax.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!rutgers!seismo!mcvax!guido From: guido@mcvax.uucp (Guido van Rossum) Newsgroups: net.lang.c Subject: Re: Disappearing function call Message-ID: <7098@boring.mcvax.UUCP> Date: Sat, 11-Oct-86 08:30:59 EDT Article-I.D.: boring.7098 Posted: Sat Oct 11 08:30:59 1986 Date-Received: Mon, 13-Oct-86 00:41:51 EDT References: <357@cullvax.UUCP> Reply-To: guido@boring.uucp (Guido van Rossum) Organization: "Stamp Out BASIC" Committee, CWI, Amsterdam Lines: 25 Apparently-To: rnews@mcvax