• 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: Token Concatation in Info.plist Files?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Token Concatation in Info.plist Files?


  • Subject: Re: Token Concatation in Info.plist Files?
  • From: Douglas Norton <email@hidden>
  • Date: Sun, 4 Feb 2007 20:59:03 -0800

Try this:

#define		__macroConcat2A( a, b  )		a##b
#define		__macroConcat2( a, b )		__macroConcat2A( a, b )

I did some hunting and research on various sites, and even the archive to this list.

I think you can only use the ## within a macro definition, and you need two macros to get it to work. I do not understand why, I tried it with one and it didn't work, and then found something that said use the double definition method above.

If you are trying to make version number for a pList, then you might need something like this:

#define __macroConcat5A( a, b, c, d, e ) a##b##c##d##e
#define __macroConcat5( a, b, c, d, e ) __macroConcat5A( a, b, c, d, e )


#define	MAJOR_NUMBER		1
#define	MINOR_NUMBER		2
#define	FIXER_NUMBER			3

#define VERSION_NUMBER __macroConcat5( MAJOR_NUMBER, ., MINOR_NUMBER, ., FIXER_NUMBER )

This should give you 1.2.3 ready for use in a pList.

Douglas

On Feb 4, 2007, at 7:01 PM, Andreas Wittenstein wrote:

If I check the 'Preprocess Info.plist File' box for a target, then '#include', '#define', '#if' work correctly. That's a great convenience. Token stringification works too.

But token concatenation doesn't work. For example,

	#define kPrefix a
	#define kSuffix b

	kPrefix##kSuffix
	kPrefix ## kSuffix

expands to

	a##b
	a ## b

instead of

	ab
	ab

Andreas Wittenstein
BitJazz Inc.
http://www.bitjazz.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Token Concatation in Info.plist Files?
      • From: Andreas Wittenstein <email@hidden>
References: 
 >Token Concatation in Info.plist Files? (From: Andreas Wittenstein <email@hidden>)

  • Prev by Date: Token Concatation in Info.plist Files?
  • Next by Date: GCC inline asm error
  • Previous by thread: Token Concatation in Info.plist Files?
  • Next by thread: Re: Token Concatation in Info.plist Files?
  • Index(es):
    • Date
    • Thread