• 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: #define xxx #define yyy 123
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #define xxx #define yyy 123


  • Subject: Re: #define xxx #define yyy 123
  • From: Terry Lambert <email@hidden>
  • Date: Thu, 10 Jan 2008 09:28:31 -0800

You can't do this in the preprocessor alone. You can cause multiple passes using a Makefile with intermediate target rules, if you absolutely must, but it's highly discouraged unless you are entering an obfuscated C contest.

-- Terry

On Jan 10, 2008, at 4:09 AM, charlie <email@hidden> wrote:


How do you get a define to be allowed within a define....

#define xxx #define yyy 123


More specifically, what I'm trying to do is this:

#define begin_enumerations #pragma options enum=4


But the compiler gives me the following error:

error: '#' is not followed by a macro parameter


It's interesting though.. I get the following error on the line where I use begin_enumerations:


error: syntax error at '#' token

... as if the #pragma options enum=4 actually made it down there to that line.


Is there some way to force the preprocessor to make a second pass?

- chuck


_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: #define xxx #define yyy 123
      • From: Greg Shenaut <email@hidden>
References: 
 >#define xxx #define yyy 123 (From: "charlie" <email@hidden>)

  • Prev by Date: IOKit: Unable to catch shutdown for power management(QA 1340)
  • Next by Date: Re: A Bug in pthread_cond_destroy?
  • Previous by thread: Re: #define xxx #define yyy 123
  • Next by thread: Re: #define xxx #define yyy 123
  • Index(es):
    • Date
    • Thread