Currently the libcurl code checks for MAC_10_? and IPHONE_?_? to determine what it is compiling against.. However that is incorrect usage, as those macros document what is installed on the development system, not what SDK is being compiled against. (yeah.. rather silly IMHO).
The cause is that some of the recent changes in darwin_ssl fail to compile when compiling on a 10.6 SDK. The CopyIdentityWithLabel includes some new code that has this define check
#if defined(__MAC_10_6) || defined(__IPHONE_2_0) // check and use SecItemCopyMatching() #endif
However, the SecItemCopyMatching code does not in fact compile on 10.6 SDK as an extra header needs to be included explicitly (<Security SecItem.h="">) AND it doesn't define kSecClassIdentity.
Now changing the definition to
#if defined(__MAC_10_7) || defined(__IPHONE_2_0)
however does not work as my /usr/include/Availability.h defines __IPHONE_2_0 (even in an Mac compilation) as I have that SDK installed on my system!.
The proper checks should be
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 20000
Read more on this usage in the Availability.h header itself.. These defines are automatically set by the compiler according to which SDK is being used to compile with. (and in the case of OS X compiling the iphone define is undefined and evaluates as 0 in the comparison so it works correctly.