• 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
variadic variable argument list in #define
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

variadic variable argument list in #define


  • Subject: variadic variable argument list in #define
  • From: Ben Dougall <email@hidden>
  • Date: Tue, 10 Feb 2004 00:30:09 +0000

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?

i'd like to use a variable argument list in a #define macro just like what's at the start of the above linked to page, but when i use it like this for example:

#define mf(...) myfunction(__VA_ARGS__,NULL)

i get:

Compiling main.m (1 error, 4 warnings)
main.m:15:37: warning: __VA_ARGS__ can only appear in the expansion of a C99 variadic macro
main.m:15: `__VA_ARGS__' undeclared (first use in this function)
main.m:15: (Each undeclared identifier is reported only once
main.m:15: for each function it appears in.)
main.m:24:27: warning: __VA_ARGS__ can only appear in the expansion of a C99 variadic macro

is it possible to use in obj-c code?

thanks, ben.
_______________________________________________
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: Marten van Gelderen <email@hidden>
    • Re: variadic variable argument list in #define
      • From: "b.bum" <email@hidden>
    • Re: variadic variable argument list in #define
      • From: Jens Bauer <email@hidden>
    • Re: variadic variable argument list in #define
      • From: Jens Bauer <email@hidden>
  • Prev by Date: Re: applicationShouldTerminateAfterLastWindowClosed
  • Next by Date: Re: Order an NSDictionary.
  • Previous by thread: Re: Order an NSDictionary.
  • Next by thread: Re: variadic variable argument list in #define
  • Index(es):
    • Date
    • Thread