From 96a16f26128451df92be39383002c1d49ec9c4e6 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Fri, 30 Dec 2016 16:14:42 +0800 Subject: [PATCH] Remove static_assert for clang --- src/obfs_tls.h | 14 -------------- src/utils.h | 2 -- 2 files changed, 16 deletions(-) diff --git a/src/obfs_tls.h b/src/obfs_tls.h index 8cef5c14..29f6f2a6 100644 --- a/src/obfs_tls.h +++ b/src/obfs_tls.h @@ -46,8 +46,6 @@ struct tls_client_hello { short ext_len; } __attribute__((packed, aligned(1))); -STATIC_ASSERT(sizeof(struct tls_client_hello) == 138, tls_client_hello); - struct tls_ext_server_name { short ext_type; short ext_len; @@ -57,16 +55,12 @@ struct tls_ext_server_name { // char server_name[server_name_len]; } __attribute__((packed, aligned(1))); -STATIC_ASSERT(sizeof(struct tls_ext_server_name) == 9, tls_ext_server_name); - struct tls_ext_session_ticket { short session_ticket_type; short session_ticket_ext_len; // char session_ticket[session_ticket_ext_len]; } __attribute__((packed, aligned(1))); -STATIC_ASSERT(sizeof(struct tls_ext_session_ticket) == 4, tls_ext_session_ticket); - struct tls_ext_others { short ec_point_formats_ext_type; short ec_point_formats_ext_len; @@ -90,8 +84,6 @@ struct tls_ext_others { short extended_master_secret_ext_len; } __attribute__((packed, aligned(1))); -STATIC_ASSERT(sizeof(struct tls_ext_others) == 66, tls_ext_others); - struct tls_server_hello { char content_type; short version; @@ -123,8 +115,6 @@ struct tls_server_hello { char ec_point_formats[1]; } __attribute__((packed, aligned(1))); -STATIC_ASSERT(sizeof(struct tls_server_hello) == 96, tls_server_hello); - struct tls_change_cipher_spec { char content_type; short version; @@ -132,8 +122,6 @@ struct tls_change_cipher_spec { char msg; } __attribute__((packed, aligned(1))); -STATIC_ASSERT(sizeof(struct tls_change_cipher_spec) == 6, tls_change_cipher_spec); - struct tls_encrypted_handshake { char content_type; short version; @@ -141,8 +129,6 @@ struct tls_encrypted_handshake { // char msg[len]; } __attribute__((packed, aligned(1))); -STATIC_ASSERT(sizeof(struct tls_encrypted_handshake) == 5, tls_encrypted_handshake); - typedef struct frame { short idx; short len; diff --git a/src/utils.h b/src/utils.h index 4e79647c..0fb7f5a2 100644 --- a/src/utils.h +++ b/src/utils.h @@ -229,6 +229,4 @@ void *ss_realloc(void *ptr, size_t new_size); ptr = NULL; \ } while (0) -#define STATIC_ASSERT(COND,MSG) typedef char static_assertion_##MSG[(COND)?1:-1] - #endif // _UTILS_H