aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2016-01-18 22:23:17 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2016-01-18 22:23:17 -0500
commit535dee02154cbb842fab2fdf6706e10ab57a5840 (patch)
tree537fc553a13bc478959a12ab15479530ad498e2e /src/_cffi_src
parent9244deaa07e92399556e8f5d0f7b32cf79f2e201 (diff)
parent96f7cdb53e1cd46a6432cda24d2aec98fabf81a9 (diff)
downloadcryptography-535dee02154cbb842fab2fdf6706e10ab57a5840.tar.gz
cryptography-535dee02154cbb842fab2fdf6706e10ab57a5840.tar.bz2
cryptography-535dee02154cbb842fab2fdf6706e10ab57a5840.zip
Merge pull request #2678 from reaperhulk/windows-hacks
consolidate the windows specific header trickery we need to do
Diffstat (limited to 'src/_cffi_src')
-rw-r--r--src/_cffi_src/build_openssl.py12
-rw-r--r--src/_cffi_src/openssl/cms.py5
2 files changed, 8 insertions, 9 deletions
diff --git a/src/_cffi_src/build_openssl.py b/src/_cffi_src/build_openssl.py
index ebbe8865..491d1740 100644
--- a/src/_cffi_src/build_openssl.py
+++ b/src/_cffi_src/build_openssl.py
@@ -37,7 +37,11 @@ def _osx_libraries(build_static):
return ["ssl", "crypto"]
-_OSX_PRE_INCLUDE = """
+_PRE_INCLUDE = """
+#include <openssl/e_os2.h>
+#if defined(OPENSSL_SYS_WINDOWS)
+#include <windows.h>
+#endif
#ifdef __APPLE__
#include <AvailabilityMacros.h>
#define __ORIG_DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER \
@@ -47,7 +51,7 @@ _OSX_PRE_INCLUDE = """
#endif
"""
-_OSX_POST_INCLUDE = """
+_POST_INCLUDE = """
#ifdef __APPLE__
#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER \
@@ -92,8 +96,8 @@ ffi = build_ffi_for_binding(
"pkcs7",
"callbacks",
],
- pre_include=_OSX_PRE_INCLUDE,
- post_include=_OSX_POST_INCLUDE,
+ pre_include=_PRE_INCLUDE,
+ post_include=_POST_INCLUDE,
libraries=_get_openssl_libraries(sys.platform),
extra_link_args=extra_link_args(compiler_type()),
)
diff --git a/src/_cffi_src/openssl/cms.py b/src/_cffi_src/openssl/cms.py
index fef7325c..dbe276e9 100644
--- a/src/_cffi_src/openssl/cms.py
+++ b/src/_cffi_src/openssl/cms.py
@@ -6,11 +6,6 @@ from __future__ import absolute_import, division, print_function
INCLUDES = """
#if !defined(OPENSSL_NO_CMS) && OPENSSL_VERSION_NUMBER >= 0x0090808fL
-/* The next define should really be in the OpenSSL header, but it is missing.
- Failing to include this on Windows causes compilation failures. */
-#if defined(OPENSSL_SYS_WINDOWS)
-#include <windows.h>
-#endif
#include <openssl/cms.h>
#endif
"""