| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On May 25, 2005, at 7:33 PM, Peter S Lau wrote:
/* Call a function that only exists in Mac OS X 10.3 or later */ #if defined(MAC_OS_X_VERSION_10_3) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3) if ( HIAboutBox != NULL ) { err = HIAboutBox(NULL); } #endif /* Call a function that only exists in Mac OS X 10.4 or later */ #if defined(MAC_OS_X_VERSION_10_4) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) if ( HISearchWindowShow != NULL) { err = HISearchWindowShow(CFSTR("Cross-Development"), kNilOptions); } #endif The #ifs protect you from compile errors if you set the SDK (or build on a version of Mac OS X) whose headers don't have the symbol. The if ( foo != NULL ) protects you from calling a weak-linked function that is not defined at runtime. Chris |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden This email sent to email@hidden
| References: | |
| >Re: MacOSX10.3.0 sdk install? (From: Peter S Lau <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.