Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Info.plist preprocessor macro expansion, space between tokens



Title: Re: Info.plist preprocessor macro expansion, space between tokens
Thanks, Robert, that works perfectly!
 
- Alex


From: xcode-users-bounces+asheh=email@hidden [mailto:xcode-users-bounces+asheh=email@hidden] On Behalf Of Robert J. Lang
Sent: Tuesday, May 16, 2006 12:57 PM
To: XCode Users List
Subject: Re: Info.plist preprocessor macro expansion, space between tokens

on 4/28/06 4:49 PM, Alex Sheh at email@hidden wrote:

Hi all,
Is there anyway to get the Info.plist preprocessor NOT to add whitespace between tokens during macro expansion?

This works. The two-stage construction does the trick.
Robert


#define VERSION_MAJOR 4
#define VERSION_MINOR 0
#define VERSION_BUGFIX 0

/* Symbols needed for Info.plist; ugly multistage construction because
  they need to be symbols, not strings, no quotes, no whitespace */
#define MACRO_PASTE_5(a, b, c, d, e) a##b##c##d##e
#define MACRO_PASTE_5A(a, b, c, d, e) MACRO_PASTE_5(a, b, c, d, e)
#define MAC_CFBUNDLE_SHORT_VERSION_STRING \
  MACRO_PASTE_5A(VERSION_MAJOR, ., VERSION_MINOR, ., VERSION_BUGFIX)

The symbol MAC_CFBUNDLE_SHORT_VERSION_STRING now gives the desired result and can be used in your Info.plist.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.