diff --git a/include/openssl/aead.h b/include/openssl/aead.h index 2a9ce90a..7d9ee1f1 100644 --- a/include/openssl/aead.h +++ b/include/openssl/aead.h @@ -334,7 +334,7 @@ OPENSSL_EXPORT int EVP_AEAD_CTX_get_iv(const EVP_AEAD_CTX *ctx, #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h index 4756de8c..e1c9447c 100644 --- a/include/openssl/asn1.h +++ b/include/openssl/asn1.h @@ -1017,7 +1017,7 @@ OPENSSL_EXPORT ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); #ifdef __cplusplus } -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/base.h b/include/openssl/base.h index 7fdaed43..21eb04fe 100644 --- a/include/openssl/base.h +++ b/include/openssl/base.h @@ -170,6 +170,13 @@ extern "C" { #define OPENSSL_MSVC_PRAGMA(arg) #endif +/* MSVC doesn't set __cplusplus to 201103 to indicate C++11 support (see + * https://connect.microsoft.com/VisualStudio/feedback/details/763051/a-value-of-predefined-macro-cplusplus-is-still-199711l) + * so MSVC is just assumed to support C++11. */ +#if defined(__cplusplus) && (__cplusplus >= 201103 || defined(_MSC_VER)) +#define BORINGSSL_HAVE_CXX11 +#endif + /* CRYPTO_THREADID is a dummy value. */ typedef int CRYPTO_THREADID; @@ -294,7 +301,7 @@ typedef void *OPENSSL_BLOCK; } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/bio.h b/include/openssl/bio.h index 75449bdd..5ec40b22 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h @@ -896,7 +896,7 @@ struct bio_st { #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/bn.h b/include/openssl/bn.h index 9764140c..03ea7dc8 100644 --- a/include/openssl/bn.h +++ b/include/openssl/bn.h @@ -867,7 +867,7 @@ OPENSSL_EXPORT unsigned BN_num_bits_word(BN_ULONG l); #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/bytestring.h b/include/openssl/bytestring.h index 7352411f..b969662d 100644 --- a/include/openssl/bytestring.h +++ b/include/openssl/bytestring.h @@ -394,7 +394,7 @@ OPENSSL_EXPORT int CBB_add_asn1_uint64(CBB *cbb, uint64_t value); #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h index ecab121b..984e3f32 100644 --- a/include/openssl/cipher.h +++ b/include/openssl/cipher.h @@ -541,7 +541,7 @@ struct evp_cipher_st { #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/cmac.h b/include/openssl/cmac.h index c536beff..e66ac4f2 100644 --- a/include/openssl/cmac.h +++ b/include/openssl/cmac.h @@ -72,7 +72,7 @@ OPENSSL_EXPORT int CMAC_Final(CMAC_CTX *ctx, uint8_t *out, size_t *out_len); #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/curve25519.h b/include/openssl/curve25519.h index 5eaa191f..e5b847a5 100644 --- a/include/openssl/curve25519.h +++ b/include/openssl/curve25519.h @@ -168,7 +168,7 @@ OPENSSL_EXPORT int SPAKE2_process_msg(SPAKE2_CTX *ctx, uint8_t *out_key, #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/dh.h b/include/openssl/dh.h index c750970e..b929c672 100644 --- a/include/openssl/dh.h +++ b/include/openssl/dh.h @@ -256,7 +256,7 @@ struct dh_st { #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/digest.h b/include/openssl/digest.h index b749092f..d13dfc8b 100644 --- a/include/openssl/digest.h +++ b/include/openssl/digest.h @@ -261,7 +261,7 @@ struct env_md_ctx_st { #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/ec.h b/include/openssl/ec.h index 124b9894..b149c45b 100644 --- a/include/openssl/ec.h +++ b/include/openssl/ec.h @@ -357,7 +357,7 @@ OPENSSL_EXPORT size_t EC_get_builtin_curves(EC_builtin_curve *out_curves, #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/ec_key.h b/include/openssl/ec_key.h index 78b2f256..5b0f516f 100644 --- a/include/openssl/ec_key.h +++ b/include/openssl/ec_key.h @@ -323,7 +323,7 @@ OPENSSL_EXPORT int i2o_ECPublicKey(const EC_KEY *key, unsigned char **outp); #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/ecdsa.h b/include/openssl/ecdsa.h index 30e7ef36..3a04adf3 100644 --- a/include/openssl/ecdsa.h +++ b/include/openssl/ecdsa.h @@ -195,7 +195,7 @@ OPENSSL_EXPORT int i2d_ECDSA_SIG(const ECDSA_SIG *sig, uint8_t **outp); #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 64554cd8..263944e1 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -748,7 +748,7 @@ struct evp_pkey_st { #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/hmac.h b/include/openssl/hmac.h index 4e1c7b90..6a6c8c00 100644 --- a/include/openssl/hmac.h +++ b/include/openssl/hmac.h @@ -154,7 +154,7 @@ struct hmac_ctx_st { #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/mem.h b/include/openssl/mem.h index aca489b7..172198df 100644 --- a/include/openssl/mem.h +++ b/include/openssl/mem.h @@ -134,7 +134,7 @@ OPENSSL_EXPORT int BIO_vsnprintf(char *buf, size_t n, const char *format, #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/newhope.h b/include/openssl/newhope.h index 16900fce..3d91ce78 100644 --- a/include/openssl/newhope.h +++ b/include/openssl/newhope.h @@ -143,7 +143,7 @@ OPENSSL_EXPORT void NEWHOPE_offer_frommsg( #if defined(__cplusplus) } /* extern "C" */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/pkcs8.h b/include/openssl/pkcs8.h index a6bf7594..87d1e053 100644 --- a/include/openssl/pkcs8.h +++ b/include/openssl/pkcs8.h @@ -188,7 +188,7 @@ OPENSSL_EXPORT void PKCS12_free(PKCS12 *p12); #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/rsa.h b/include/openssl/rsa.h index 513fb33c..f6abdfb9 100644 --- a/include/openssl/rsa.h +++ b/include/openssl/rsa.h @@ -613,7 +613,7 @@ struct rsa_st { #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 917601e7..583cbf86 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -4506,7 +4506,7 @@ OPENSSL_EXPORT int SSL_set_ssl_method(SSL *s, const SSL_METHOD *method); #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/stack.h b/include/openssl/stack.h index 4c0a3e88..b5213532 100644 --- a/include/openssl/stack.h +++ b/include/openssl/stack.h @@ -291,7 +291,7 @@ OPENSSL_EXPORT _STACK *sk_deep_copy(const _STACK *sk, #if defined(__cplusplus) } /* extern C */ -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl { diff --git a/include/openssl/x509.h b/include/openssl/x509.h index cfe96573..e57d6152 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -1226,7 +1226,7 @@ OPENSSL_EXPORT int PKCS7_get_PEM_CRLs(STACK_OF(X509_CRL) *out_crls, #ifdef __cplusplus } -#if __cplusplus >= 201103 +#if defined(BORINGSSL_HAVE_CXX11) namespace bssl {