Assume that MSVC supports C++11.
MSVC doesn't define __cplusplus as 201103 to indicate C++11 support, so
just assume that the compiler supports C++11 if _MSC_VER is defined.
Change-Id: I27f6eeefe6e8dc522470f36fab76ab36d85eebac
Reviewed-on: https://boringssl-review.googlesource.com/8734
Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/include/openssl/aead.h b/include/openssl/aead.h
index 2a9ce90..7d9ee1f 100644
--- a/include/openssl/aead.h
+++ b/include/openssl/aead.h
@@ -334,7 +334,7 @@
#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 4756de8..e1c9447 100644
--- a/include/openssl/asn1.h
+++ b/include/openssl/asn1.h
@@ -1017,7 +1017,7 @@
#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 7fdaed4..21eb04f 100644
--- a/include/openssl/base.h
+++ b/include/openssl/base.h
@@ -170,6 +170,13 @@
#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 @@
} /* 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 75449bd..5ec40b2 100644
--- a/include/openssl/bio.h
+++ b/include/openssl/bio.h
@@ -896,7 +896,7 @@
#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 9764140..03ea7dc 100644
--- a/include/openssl/bn.h
+++ b/include/openssl/bn.h
@@ -867,7 +867,7 @@
#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 7352411..b969662 100644
--- a/include/openssl/bytestring.h
+++ b/include/openssl/bytestring.h
@@ -394,7 +394,7 @@
#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 ecab121..984e3f3 100644
--- a/include/openssl/cipher.h
+++ b/include/openssl/cipher.h
@@ -541,7 +541,7 @@
#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 c536bef..e66ac4f 100644
--- a/include/openssl/cmac.h
+++ b/include/openssl/cmac.h
@@ -72,7 +72,7 @@
#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 5eaa191..e5b847a 100644
--- a/include/openssl/curve25519.h
+++ b/include/openssl/curve25519.h
@@ -168,7 +168,7 @@
#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 c750970..b929c67 100644
--- a/include/openssl/dh.h
+++ b/include/openssl/dh.h
@@ -256,7 +256,7 @@
#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 b749092..d13dfc8 100644
--- a/include/openssl/digest.h
+++ b/include/openssl/digest.h
@@ -261,7 +261,7 @@
#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 124b989..b149c45 100644
--- a/include/openssl/ec.h
+++ b/include/openssl/ec.h
@@ -357,7 +357,7 @@
#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 78b2f25..5b0f516 100644
--- a/include/openssl/ec_key.h
+++ b/include/openssl/ec_key.h
@@ -323,7 +323,7 @@
#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 30e7ef3..3a04adf 100644
--- a/include/openssl/ecdsa.h
+++ b/include/openssl/ecdsa.h
@@ -195,7 +195,7 @@
#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 64554cd..263944e 100644
--- a/include/openssl/evp.h
+++ b/include/openssl/evp.h
@@ -748,7 +748,7 @@
#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 4e1c7b9..6a6c8c0 100644
--- a/include/openssl/hmac.h
+++ b/include/openssl/hmac.h
@@ -154,7 +154,7 @@
#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 aca489b..172198d 100644
--- a/include/openssl/mem.h
+++ b/include/openssl/mem.h
@@ -134,7 +134,7 @@
#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 16900fc..3d91ce7 100644
--- a/include/openssl/newhope.h
+++ b/include/openssl/newhope.h
@@ -143,7 +143,7 @@
#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 a6bf759..87d1e05 100644
--- a/include/openssl/pkcs8.h
+++ b/include/openssl/pkcs8.h
@@ -188,7 +188,7 @@
#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 513fb33..f6abdfb 100644
--- a/include/openssl/rsa.h
+++ b/include/openssl/rsa.h
@@ -613,7 +613,7 @@
#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 917601e..583cbf8 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -4506,7 +4506,7 @@
#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 4c0a3e8..b521353 100644
--- a/include/openssl/stack.h
+++ b/include/openssl/stack.h
@@ -291,7 +291,7 @@
#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 cfe9657..e57d615 100644
--- a/include/openssl/x509.h
+++ b/include/openssl/x509.h
@@ -1226,7 +1226,7 @@
#ifdef __cplusplus
}
-#if __cplusplus >= 201103
+#if defined(BORINGSSL_HAVE_CXX11)
namespace bssl {