From 76ec34058a30026b62cc6f16a6c172fe5011798d Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 12 Dec 2013 13:42:23 -0800 Subject: Attempt to fix nebulous indentation complaints and also re-set after the includes. --- cryptography/hazmat/bindings/openssl/backend.py | 28 ++++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/cryptography/hazmat/bindings/openssl/backend.py b/cryptography/hazmat/bindings/openssl/backend.py index d093684e..044e8cc9 100644 --- a/cryptography/hazmat/bindings/openssl/backend.py +++ b/cryptography/hazmat/bindings/openssl/backend.py @@ -112,18 +112,30 @@ class Backend(object): # int foo(int); # int foo(short); - preamble = [ -""" + pre_includes = [""" #ifdef __APPLE__ -# include -# undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER -# define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER +#include +#define __ORIG_DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER \ + DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER +#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER +#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER #endif -""" - ] +"""] + + post_includes = [""" +#ifdef __APPLE__ +#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER +#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER \ + __ORIG_DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER +#endif +"""] lib = ffi.verify( - source="\n".join(preamble + includes + functions + customizations), + source="\n".join(pre_includes + + includes + + post_includes + + functions + + customizations), libraries=["crypto", "ssl"], ) -- cgit v1.2.3