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



Thanks, Greg.  I did try some token concatenation experimentation.  If I
use ## in the Info.plist itself, it ignores the concatenation and
instead outputs the '##'s themselves.

<string>MAJOR##.##MINOR##.##MICRO</string> results in 1##.##2##.##.3

If I do the token concatenation in the Info.plist prefix header then
concatenation is interpreted correctly, but unfortunately I get "does
not give a valid preprocessing token" errors because of the "." dot.

#define VERSIONSTR MAJOR##.##MINOR##.##MICRO

- Alex

-----Original Message-----
From: xcode-users-bounces+asheh=email@hidden
[mailto:xcode-users-bounces+asheh=email@hidden] On
Behalf Of Greg Guerin
Sent: Sunday, April 30, 2006 6:20 PM
To: email@hidden
Subject: Re: Info.plist preprocessor macro expansion, space between
tokens

Alex Sheh wrote:

>Is there anyway to get the Info.plist preprocessor NOT to add 
>whitespace between tokens during macro expansion?
>
>Info.plist prefix header
>#define MAJOR 1
>#define MINOR 2
>#define MICRO 3
> 
>Info.plist contents
><key> CFBundleShortVersionString <\key> <string> MAJOR.MINOR.MICRO 
><\string>

<string>MAJOR##.##MINOR##.##MICRO</string> ?

This assumes the plist preprocessor is using standard C notations.
"Token pasting" or "concatenation" is standard C preprocessor notation.
E.g.:

<http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/cpp/C
oncatenation.html>


Also, you have backslashes in your end-tags that need to be /'s.

  -- GG


 _______________________________________________
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
 _______________________________________________
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.