Define BORINGSSL_NO_CXX if !__cplusplus.

This should make it a little easier to write C++-only public headers.

Change-Id: Ie5bff241c810cb5330f66d8a4dc1dd8b2d69c7c9
Reviewed-on: https://boringssl-review.googlesource.com/18225
Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
David Benjamin 2017-07-20 12:50:11 -04:00
parent 9f9f4eaa2e
commit ebb4a37ed2

View File

@ -340,6 +340,9 @@ typedef void *OPENSSL_BLOCK;
#if defined(__cplusplus) #if defined(__cplusplus)
} /* extern C */ } /* extern C */
#elif !defined(BORINGSSL_NO_CXX)
#define BORINGSSL_NO_CXX
#endif
// MSVC doesn't set __cplusplus to 201103 to indicate C++11 support (see // 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) // https://connect.microsoft.com/VisualStudio/feedback/details/763051/a-value-of-predefined-macro-cplusplus-is-still-199711l)
@ -370,8 +373,6 @@ extern "C++" {
extern "C++" { extern "C++" {
#include <memory>
namespace bssl { namespace bssl {
namespace internal { namespace internal {
@ -452,6 +453,4 @@ using UniquePtr = std::unique_ptr<T, internal::Deleter<T>>;
#endif // !BORINGSSL_NO_CXX #endif // !BORINGSSL_NO_CXX
#endif
#endif /* OPENSSL_HEADER_BASE_H */ #endif /* OPENSSL_HEADER_BASE_H */