On 23/02/16 01:55, Bill Bierman wrote:
> The Microsoft compiler team has suggested removing the include of ssl.h
> from srtp.h as it creates a circular reference which is likely confusing
> the compiler.
> 
> On Mon, Feb 22, 2016 at 2:19 PM, Bill Bierman <b...@thebiermans.org
> <mailto:b...@thebiermans.org>> wrote:
> 
>     Hello.  I'm sorry I cannot reply to the thread.  I only just now
>     have subscribed to the list.
> 
>     I can confirm that this problem exists with Visual Studio 2015 on HEAD.
> 
>     I spoke to a friend of mine who works at MS who relayed this to the
>     compiler team.  A senior dev there is aware of the issue and they
>     are working on a fix.


The attached seems to avoid the problem - but then for reasons I cannot
understand link errors result later on in the build.

Matt
>From 68db934d65513236b6e0ffd5290d0f53b71f56c9 Mon Sep 17 00:00:00 2001
From: Matt Caswell <m...@openssl.org>
Date: Tue, 23 Feb 2016 15:27:05 +0000
Subject: [PATCH] Workaround for VisualStudio 2015 bug

VisualStudio 2015 has a bug where an internal compiler error was occurring.
By reordering the DEFINE_STACK_OF declarations for SSL_CIPHER and SSL_COMP
until after the ssl3.h include everything seems ok again.
---
 include/openssl/ssl.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index 9709103..b6e6960 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -326,8 +326,6 @@ typedef struct tls_sigalgs_st TLS_SIGALGS;
 typedef struct ssl_conf_ctx_st SSL_CONF_CTX;
 typedef struct ssl_comp_st SSL_COMP;
 
-DEFINE_STACK_OF_CONST(SSL_CIPHER)
-DEFINE_STACK_OF(SSL_COMP)
 
 /* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/
 typedef struct srtp_protection_profile_st {
@@ -907,6 +905,13 @@ __owur int SSL_extension_supported(unsigned int ext_type);
 extern "C" {
 #endif
 
+/*
+ * These need to be after the above set of includes due to a compiler bug
+ * in VisualStudio 2015
+ */
+DEFINE_STACK_OF_CONST(SSL_CIPHER)
+DEFINE_STACK_OF(SSL_COMP)
+
 /* compatibility */
 # define SSL_set_app_data(s,arg)         (SSL_set_ex_data(s,0,(char *)arg))
 # define SSL_get_app_data(s)             (SSL_get_ex_data(s,0))
-- 
2.5.0

-- 
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

Reply via email to