Is it possible to define a macro called IPHONE_ONLY for conditional compilation that looks like this:
IPHONE_ONLY -(void)myMethod {
//method body
}
or
IPHONE_ONLY( -(void)myMethod {
//method body
})
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Even though normally you would surround the function with
#ifdef, I tested with gcc and indeed the following also works. I don’t know if it is standard:I have never seen anyone code like that though. It is quite common to write such a function like this:
Your editor also would be much happier with this, since it understands functions, but not function body used as a macro parameter!