From b8e012e1ff736cc794273af4a7db521e6b18bcd5 Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Wed, 16 Aug 2023 17:57:49 +0000 Subject: [PATCH] Make a BSSL_CHECK that always aborts Change-Id: Ie1867ed8a9763331bcc83482cfb22f1e39a281d4 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/62366 Reviewed-by: David Benjamin Commit-Queue: Bob Beck --- include/openssl/base.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/openssl/base.h b/include/openssl/base.h index 97a17bb3a..9430c8ef3 100644 --- a/include/openssl/base.h +++ b/include/openssl/base.h @@ -58,6 +58,7 @@ #include #include +#include #include #if defined(__MINGW32__) @@ -383,6 +384,13 @@ typedef struct x509_trust_st X509_TRUST; typedef void *OPENSSL_BLOCK; +// BSSL_CHECK aborts if |condition| is not true. +#define BSSL_CHECK(condition) \ + do { \ + if (!(condition)) { \ + abort(); \ + } \ + } while (0); #if defined(__cplusplus) } // extern C