summaryrefslogtreecommitdiffstats
path: root/engines/e_capi.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2016-06-26 13:40:15 +0200
committerAndy Polyakov <appro@openssl.org>2016-07-08 11:49:44 +0200
commitf1f5ee17b64397eecfde39960ca11e94064297bd (patch)
tree811a0a155a461065aecca798e7b7e090de7b80d9 /engines/e_capi.c
parentSupport PKCS v2.0 print in pkcs12 utility. (diff)
downloadopenssl-f1f5ee17b64397eecfde39960ca11e94064297bd.tar.xz
openssl-f1f5ee17b64397eecfde39960ca11e94064297bd.zip
include/openssl: don't include <windows.h> in public headers.
If application uses any of Windows-specific interfaces, make it application developer's respondibility to include <windows.h>. Rationale is that <windows.h> is quite "toxic" and is sensitive to inclusion order (most notably in relation to <winsock2.h>). It's only natural to give complete control to the application developer. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'engines/e_capi.c')
-rw-r--r--engines/e_capi.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/engines/e_capi.c b/engines/e_capi.c
index 4923eefa55..9e9e4f3246 100644
--- a/engines/e_capi.c
+++ b/engines/e_capi.c
@@ -7,13 +7,23 @@
* https://www.openssl.org/source/license.html
*/
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
+#ifdef _WIN32
+# ifndef _WIN32_WINNT
+# define _WIN32_WINNT 0x0400
+# endif
+# include <windows.h>
+# include <wincrypt.h>
+
+# include <stdio.h>
+# include <string.h>
+# include <stdlib.h>
+# include <malloc.h>
+# ifndef alloca
+# define alloca _alloca
+# endif
-#include <openssl/crypto.h>
+# include <openssl/crypto.h>
-#ifdef OPENSSL_SYS_WIN32
# ifndef OPENSSL_NO_CAPIENG
# include <openssl/buffer.h>
@@ -21,17 +31,6 @@
# include <openssl/rsa.h>
# include <openssl/dsa.h>
-# ifndef _WIN32_WINNT
-# define _WIN32_WINNT 0x0400
-# endif
-
-# include <windows.h>
-# include <wincrypt.h>
-# include <malloc.h>
-# ifndef alloca
-# define alloca _alloca
-# endif
-
/*
* This module uses several "new" interfaces, among which is
* CertGetCertificateContextProperty. CERT_KEY_PROV_INFO_PROP_ID is
@@ -50,7 +49,7 @@
# define __COMPILE_CAPIENG
# endif /* CERT_KEY_PROV_INFO_PROP_ID */
# endif /* OPENSSL_NO_CAPIENG */
-#endif /* OPENSSL_SYS_WIN32 */
+#endif /* _WIN32 */
#ifdef __COMPILE_CAPIENG