Universal Binaries with 10.2.8 vs 10.4 conditional compiling
Universal Binaries with 10.2.8 vs 10.4 conditional compiling
- Subject: Universal Binaries with 10.2.8 vs 10.4 conditional compiling
- From: Stephane Odul <email@hidden>
- Date: Fri, 7 Apr 2006 09:17:45 -0700
Hi,
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
So right now my workaround is to #ifdef on the version of gcc (as
10.2.8 requires gcc 3 and 10.4 uses gcc 4):
#if __GNUC__ == 3
This is a WORKAROUND, I should test against the current
MAC_OS_X_VERSION_MAX_ALLOWED.
Anyone has the same problem or have an idea on how to fix that ?
This is not high priority but I would like to keep my code 'clean'.
Thanks,
- Stephane
_______________________________________________
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