Re: Universal Binaries with 10.2.8 vs 10.4 conditional compiling
Re: Universal Binaries with 10.2.8 vs 10.4 conditional compiling
- Subject: Re: Universal Binaries with 10.2.8 vs 10.4 conditional compiling
- From: Steve Christensen <email@hidden>
- Date: Fri, 7 Apr 2006 13:00:05 -0700
On Apr 7, 2006, at 9:17 AM, Stephane Odul wrote:
I have some code that I want to work with 10.2.8 and 10.4 Intel,
and I have slight problem with ne of the system functions:
in 10.2 I had this:
clock_get_uptime( &now );
but with 10.4 sdk it has to be like this or I get a compiler error
(and this line is not working with the 10.2 sdk):
clock_get_uptime( (uint64_t *) &now );
So I tried to use MAC_OS_X_VERSION_MAX_ALLOWED
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
// Works with 10.2.8 sdk, 10.4 gives an error
clock_get_uptime( &now );
#else
// Works with 10.4 sdk, 10.2.8 gives an error
clock_get_uptime( (uint64_t *) &now );
#endif
And it's working just fine so long as I only compile for 10.2.8 or
10.4, but when I'm doing an universal binary it seems I'm always
hitting the 10.4u SDK and of course I'm getting a compile error on
clock_get_uptime.
I do have the SDK_ROOT variables set correctly:
SDKROOT_i386 $(SYSTEM_DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk
SDKROOT_ppc $(SYSTEM_DEVELOPER_DIR)/SDKs/MacOSX10.2.8.sdk
I have the following set for my Universal projects:
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk
GCC_VERSION_ppc = 3.3
MACOSX_DEPLOYMENT_TARGET_ppc = 10.3 (you could use 10.2.8 here)
MACOSX_DEPLOYMENT_TARGET_i386 = 10.4
That way you always build against the universal SDK, but post-10.2.8
symbols would be weak-linked. You could also get rid of the
conditional code.
If you'd rather leave your build settings alone, how about doing the
following instead?
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4
clock_get_uptime( &now );
#else
clock_get_uptime( (uint64_t *) &now );
#endif
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden