Browse Source

Remove static_assert for clang

pull/1026/head
Max Lv 8 years ago
parent
commit
96a16f2612
2 changed files with 0 additions and 16 deletions
  1. 14
      src/obfs_tls.h
  2. 2
      src/utils.h

14
src/obfs_tls.h

@ -46,8 +46,6 @@ struct tls_client_hello {
short ext_len; short ext_len;
} __attribute__((packed, aligned(1))); } __attribute__((packed, aligned(1)));
STATIC_ASSERT(sizeof(struct tls_client_hello) == 138, tls_client_hello);
struct tls_ext_server_name { struct tls_ext_server_name {
short ext_type; short ext_type;
short ext_len; short ext_len;
@ -57,16 +55,12 @@ struct tls_ext_server_name {
// char server_name[server_name_len]; // char server_name[server_name_len];
} __attribute__((packed, aligned(1))); } __attribute__((packed, aligned(1)));
STATIC_ASSERT(sizeof(struct tls_ext_server_name) == 9, tls_ext_server_name);
struct tls_ext_session_ticket { struct tls_ext_session_ticket {
short session_ticket_type; short session_ticket_type;
short session_ticket_ext_len; short session_ticket_ext_len;
// char session_ticket[session_ticket_ext_len]; // char session_ticket[session_ticket_ext_len];
} __attribute__((packed, aligned(1))); } __attribute__((packed, aligned(1)));
STATIC_ASSERT(sizeof(struct tls_ext_session_ticket) == 4, tls_ext_session_ticket);
struct tls_ext_others { struct tls_ext_others {
short ec_point_formats_ext_type; short ec_point_formats_ext_type;
short ec_point_formats_ext_len; short ec_point_formats_ext_len;
@ -90,8 +84,6 @@ struct tls_ext_others {
short extended_master_secret_ext_len; short extended_master_secret_ext_len;
} __attribute__((packed, aligned(1))); } __attribute__((packed, aligned(1)));
STATIC_ASSERT(sizeof(struct tls_ext_others) == 66, tls_ext_others);
struct tls_server_hello { struct tls_server_hello {
char content_type; char content_type;
short version; short version;
@ -123,8 +115,6 @@ struct tls_server_hello {
char ec_point_formats[1]; char ec_point_formats[1];
} __attribute__((packed, aligned(1))); } __attribute__((packed, aligned(1)));
STATIC_ASSERT(sizeof(struct tls_server_hello) == 96, tls_server_hello);
struct tls_change_cipher_spec { struct tls_change_cipher_spec {
char content_type; char content_type;
short version; short version;
@ -132,8 +122,6 @@ struct tls_change_cipher_spec {
char msg; char msg;
} __attribute__((packed, aligned(1))); } __attribute__((packed, aligned(1)));
STATIC_ASSERT(sizeof(struct tls_change_cipher_spec) == 6, tls_change_cipher_spec);
struct tls_encrypted_handshake { struct tls_encrypted_handshake {
char content_type; char content_type;
short version; short version;
@ -141,8 +129,6 @@ struct tls_encrypted_handshake {
// char msg[len]; // char msg[len];
} __attribute__((packed, aligned(1))); } __attribute__((packed, aligned(1)));
STATIC_ASSERT(sizeof(struct tls_encrypted_handshake) == 5, tls_encrypted_handshake);
typedef struct frame { typedef struct frame {
short idx; short idx;
short len; short len;

2
src/utils.h

@ -229,6 +229,4 @@ void *ss_realloc(void *ptr, size_t new_size);
ptr = NULL; \ ptr = NULL; \
} while (0) } while (0)
#define STATIC_ASSERT(COND,MSG) typedef char static_assertion_##MSG[(COND)?1:-1]
#endif // _UTILS_H #endif // _UTILS_H
Loading…
Cancel
Save