Restore CHECKED_CAST. Although this macro is not public API and is unused in BoringSSL, wpa_supplicant uses it to define its own stacks. Remove this once wpa_supplicant has been fixed. Change-Id: I1f85e06efe4057b6490bf93bf4dea773dcb491c5 Reviewed-on: https://boringssl-review.googlesource.com/c/32764 Reviewed-by: Robert Sloan <varomodt@google.com> Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/include/openssl/type_check.h b/include/openssl/type_check.h index 909f931..90d81f7 100644 --- a/include/openssl/type_check.h +++ b/include/openssl/type_check.h
@@ -79,6 +79,13 @@ #define OPENSSL_COMPILE_ASSERT(cond, msg) _Static_assert(cond, #msg) #endif +// CHECKED_CAST casts |p| from type |from| to type |to|. +// +// TODO(davidben): Although this macro is not public API and is unused in +// BoringSSL, wpa_supplicant uses it to define its own stacks. Remove this once +// wpa_supplicant has been fixed. +#define CHECKED_CAST(to, from, p) ((to) (1 ? (p) : (from)0)) + #if defined(__cplusplus) } // extern C