awslabs / aws-c-cal

Aws Crypto Abstraction Layer: Cross-Platform, C99 wrapper for cryptography primitives.
Apache License 2.0
34 stars 38 forks source link

Fix for osx deployment target 10.9 #145

Closed waahm7 closed 1 year ago

waahm7 commented 1 year ago

Issue #, if available:

Description of changes: Python until version 3.9 sets CMAKE_OSX_DEPLOYMENT_TARGET to 10.9, so we must continue to support it for now. This pull request fixes some warnings that arise when -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 is added.

The API_AVAILABLE macro doesn't work because it is equivalent to using the @available attribute on a declaration. @available is equivalent to __builtin_available in C which is just a runtime check and can not be used this way. source: https://developer.apple.com/documentation/swift/marking-api-availability-in-objective-c , https://epir.at/2019/10/30/api-availability-and-target-conditionals/, https://developer.apple.com/forums/thread/719208

Move the darwin specific header to the source directory because Swift compiles everything in the include directory by default. Currently, there is no good way to exclude headers.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

JonathanHenson commented 1 year ago

I just undid this two days ago because it was incorrect. Could you please verify and add an explanation about what was incorrect?

https://github.com/awslabs/aws-c-cal/pull/140