Add a BORINGSSL_ALLOW_CXX_RUNTIME build flag.

This allows us to avoid omitting all the silly abort() flags in
reasonable downstreams like Chromium, while the holdouts are fixed. It
also means that we still get the compiler checking that we've
implemented all pure virtuals in some build configurations, which we'll
put on a bot somewhere.

Bug: 132
Change-Id: If500749f7100bb22bb8e828e8ecf38a992ae9fe5
Reviewed-on: https://boringssl-review.googlesource.com/18406
Reviewed-by: Steven Valdez <svaldez@google.com>
This commit is contained in:
David Benjamin 2017-07-25 15:18:18 -04:00 committed by Steven Valdez
parent 56851c85f3
commit 506be38be1

View File

@ -219,6 +219,10 @@ UniquePtr<T> MakeUnique(Args &&... args) {
return UniquePtr<T>(New<T>(std::forward<Args>(args)...));
}
#if defined(BORINGSSL_ALLOW_CXX_RUNTIME)
#define HAS_VIRTUAL_DESTRUCTOR
#define PURE_VIRTUAL = 0
#else
/* HAS_VIRTUAL_DESTRUCTOR should be declared in any base class which defines a
* virtual destructor. This avoids a dependency on |_ZdlPv| and prevents the
* class from being used with |delete|. */
@ -229,6 +233,7 @@ UniquePtr<T> MakeUnique(Args &&... args) {
* functions. This avoids a dependency on |__cxa_pure_virtual| but loses
* compile-time checking. */
#define PURE_VIRTUAL { abort(); }
#endif
/* Protocol versions.