cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1255 Mac code is using availability macros incorrectly

From: Daniel Stenberg <bagder_at_users.sf.net>
Date: Fri, 02 Aug 2013 22:41:53 +0000

- **status**: pending --> closed-fixed

---
** [bugs:#1255] Mac code is using availability macros incorrectly**
**Status:** closed-fixed
**Created:** Thu Jul 11, 2013 05:23 PM UTC by Edward Rudd
**Last Updated:** Wed Jul 31, 2013 02:12 PM UTC
**Owner:** Daniel Stenberg
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
    ::c
    #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
    ::c
    #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 
    ::c
    #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.
---
Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2013-08-03

These mail archives are generated by hypermail.

donate! Page updated May 06, 2013.
web site info

File upload with ASP.NET