diff options
author | David Benjamin <davidben@google.com> | 2017-07-14 19:36:07 -0400 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2017-07-14 23:53:51 +0000 |
commit | a3d76d019fcf30f8486192d4c7587f6bcc253b51 (patch) | |
tree | 5e99ca3b081da1cb5f1d80a6d0c93a634ea2ba0e /ssl/d1_both.cc | |
parent | 9f2bffbb7281a4b14869a9f632f445b72900e966 (diff) | |
download | boringssl-a3d76d019fcf30f8486192d4c7587f6bcc253b51.zip boringssl-a3d76d019fcf30f8486192d4c7587f6bcc253b51.tar.gz boringssl-a3d76d019fcf30f8486192d4c7587f6bcc253b51.tar.bz2 |
Switch OPENSSL_COMPILE_ASSERT to static_assert in C++ code.
Clang for Windows does not like OPENSSL_COMPILE_ASSERT inside a function
in C++. It complains that the struct is unused. I think we worked around
this in C previously by making it expand to C11 _Static_assert when
available.
But libssl is now C++ and assumes a C++11-capable compiler. Use real
static_assert.
Bug: 132
Change-Id: I6aceb95360244bd2c80d194b80676483abb60519
Reviewed-on: https://boringssl-review.googlesource.com/17924
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'ssl/d1_both.cc')
-rw-r--r-- | ssl/d1_both.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ssl/d1_both.cc b/ssl/d1_both.cc index f25c2be..ee0ec4f 100644 --- a/ssl/d1_both.cc +++ b/ssl/d1_both.cc @@ -122,7 +122,6 @@ #include <openssl/evp.h> #include <openssl/mem.h> #include <openssl/rand.h> -#include <openssl/type_check.h> #include "../crypto/internal.h" #include "internal.h" @@ -538,9 +537,9 @@ int dtls1_finish_message(SSL *ssl, CBB *cbb, uint8_t **out_msg, * it takes ownership of |data| and releases it with |OPENSSL_free| when * done. */ static int add_outgoing(SSL *ssl, int is_ccs, uint8_t *data, size_t len) { - OPENSSL_COMPILE_ASSERT(SSL_MAX_HANDSHAKE_FLIGHT < - (1 << 8 * sizeof(ssl->d1->outgoing_messages_len)), - outgoing_messages_len_is_too_small); + static_assert(SSL_MAX_HANDSHAKE_FLIGHT < + (1 << 8 * sizeof(ssl->d1->outgoing_messages_len)), + "outgoing_messages_len is too small"); if (ssl->d1->outgoing_messages_len >= SSL_MAX_HANDSHAKE_FLIGHT) { assert(0); OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); |