Re: Preprocessing within @"SOMEDEFINEDSTRING"
Re: Preprocessing within @"SOMEDEFINEDSTRING"
- Subject: Re: Preprocessing within @"SOMEDEFINEDSTRING"
- From: Clark Cox <email@hidden>
- Date: Fri, 20 Mar 2009 11:13:58 -0700
On Fri, Mar 20, 2009 at 10:55 AM, Daniel Luis dos Santos
<email@hidden> wrote:
> Hello,
>
> I am trying to do the thing in the subject. I define a constant with
>
> #define SOMECONST aStringWithoutWhiteSpace
>
> , later in the code I have a call to a C function defined in a .m that is
> called like :
>
> aFunctionCall(@"SOMECONST")
>
> The method ends up creating a directory in which the last path component is
> the function argument. The #define is not preprocessed and instead of having
> a directory named after the constant I get the constant name in the path.
>
> Shouldn't the preprocessor see this constant before compiling and replace it
No, it shouldn't. The C preprocessor only operates on complete tokens
(i.e. it won't change part of a token, such as the text within a pair
of quotes).
--
Clark S. Cox III
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:
This email sent to email@hidden