Re: "weak link" framework refs for 10.1 compatibility?
Re: "weak link" framework refs for 10.1 compatibility?
- Subject: Re: "weak link" framework refs for 10.1 compatibility?
- From: Marco Scheurer <email@hidden>
- Date: Mon, 11 Nov 2002 17:27:48 +0100
On Monday, November 11, 2002, at 02:52 PM, Ondra Cada wrote:
On Monday, November 11, 2002, at 12:23 , Bill Cheeseman wrote:
Wow -- you sure? With the method it is just natural, but with
constants it
should not work, so far as I understand how the linker behaves :-O
:-O
These are enumeration constants in a typedef.
Ah. I havent checked -- I live in 10.1, so to speak ;), and had no
10.2 at hand at the moment.
Well, the constant declaration I was refering to was in full in my
first email:
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2
typedef enum {
NSTextFieldSquareBezel = 0,
NSTextFieldRoundedBezel = 1
} NSTextFieldBezelStyle;
#endif
Also, I did never suppose that such an experienced programmer as Marco
is would use such a self-evidently nonsensical example as using a
constant from a header... Sigh.
Yeah, I did not understand the "C constant" part, reason why I was
surprised by a statement such as "an application using C constants that
are new in 10.2 will not launch in 10.1.x or earlier".
The fact that they are constant has nothing to do with the problem, the
problem is that they are externally linked C variables, or storage. Or,
said differently, in:
FOUNDATION_EXPORT NSString *const NSFileImmutable;
the runtime problem on 10.1 is not with "const", the error will be the
same with or without it.
In the "enum" case the compiler will replace the constant with its
value, and if building on 10.1 we would get a compile-time error.
In the "variable" case, if building the following on 10.1, we would get
an error at link time.
-(void) testing { // TESTING
NSString *string = NSFileImmutable;
NSLog(@"NSFileImmutable = %@", string);
}
Marco Scheurer
Sen:te, Lausanne, Switzerland
http://www.sente.ch
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.