• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: variadic variable argument list in #define
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: variadic variable argument list in #define


  • Subject: Re: variadic variable argument list in #define
  • From: Marten van Gelderen <email@hidden>
  • Date: Tue, 10 Feb 2004 17:44:17 +0100

Hello Ben,

Try (right from the Cocoa docs):

#define myDebug(format, args...) fprintf(stderr, format, args)

or, as I did:

#define myDebug(format, args...) NSLog(format, args)

then call somewhere (I did it in -awakeFromNib):

myDebug(@"Debug: %d", 1);
myDebug(@"Debug: %d, %d", 1, 2);
myDebug(@"Debug: %d, %d, %d", 1, 2, 3);

I checked it on OSX 10.3.2 using Xcode 1.1. It worked fine.

On 10 Feb 2004, at 1:30 AM, Ben Dougall wrote:

is it possible to use the variadic macros which are detailed here: <http://developer.apple.com/documentation/DeveloperTools/gcc-3.3/cpp/ Variadic-Macros.html> in obj-c code?

--
Groeten, Marten
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: variadic variable argument list in #define
      • From: Ben Dougall <email@hidden>
References: 
 >variadic variable argument list in #define (From: Ben Dougall <email@hidden>)

  • Prev by Date: Re: XML-RPC Framework and sending files
  • Next by Date: VPN (L2TP) connection
  • Previous by thread: Re: variadic variable argument list in #define
  • Next by thread: Re: variadic variable argument list in #define
  • Index(es):
    • Date
    • Thread