mirror of
https://github.com/hufrea/byedpi.git
synced 2025-01-19 09:11:53 +00:00
Simplify assert macros
This commit is contained in:
parent
58f9ad5b07
commit
6027841374
5
main.c
5
main.c
@ -27,8 +27,9 @@
|
||||
|
||||
#define VERSION "15"
|
||||
|
||||
ASSERT_SIZE(struct in_addr, 4)
|
||||
ASSERT_SIZE(struct in6_addr, 16)
|
||||
ASSERT(sizeof(struct in_addr) == 4)
|
||||
ASSERT(sizeof(struct in6_addr) == 16)
|
||||
|
||||
|
||||
char ip_option[1] = "\0";
|
||||
|
||||
|
6
params.h
6
params.h
@ -4,6 +4,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "mpool.h"
|
||||
|
||||
@ -131,7 +132,6 @@ extern struct packet fake_udp;
|
||||
|
||||
extern char ip_option[1];
|
||||
|
||||
#define ASSERT_SIZE(stc, len) \
|
||||
static char t[-(int)sizeof(stc) + len]; \
|
||||
static char tt[(int)sizeof(t) * -1];
|
||||
#define ASSERT(exp) \
|
||||
char t[(exp) ? 1 : -1];
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user