diff options
author | Luiz Otavio O Souza <luiz@netgate.com> | 2015-09-16 08:21:32 -0500 |
---|---|---|
committer | Luiz Otavio O Souza <luiz@netgate.com> | 2015-10-20 12:10:57 -0500 |
commit | 9acd63e29a8c8d7ead4b2c4b3adc3d1a975d06ea (patch) | |
tree | 928dc90b589f7050a1e4778006ee403c5dad2c9a | |
parent | 29fb029f9904768263256d18602dd8cb2fff3191 (diff) | |
download | FreeBSD-src-9acd63e29a8c8d7ead4b2c4b3adc3d1a975d06ea.zip FreeBSD-src-9acd63e29a8c8d7ead4b2c4b3adc3d1a975d06ea.tar.gz |
MFC r286168:
convert to C11's _Static_assert, and pull in sys/cdefs.h for
compatibility w/ older non-C11 compilers...
passed make tinerdbox..
Suggested by: imp
TAG: IPSEC-HEAD
Issue: #4841
-rw-r--r-- | sys/net/pfkeyv2.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/net/pfkeyv2.h b/sys/net/pfkeyv2.h index dcd67675..ecefcac 100644 --- a/sys/net/pfkeyv2.h +++ b/sys/net/pfkeyv2.h @@ -39,9 +39,7 @@ #ifndef _NET_PFKEYV2_H_ #define _NET_PFKEYV2_H_ -#ifndef _KERNEL -#define CTASSERT(x) struct __thisisjustnothing; -#endif +#include <sys/cdefs.h> /* This file defines structures and symbols for the PF_KEY Version 2 @@ -231,7 +229,7 @@ struct sadb_x_policy { u_int32_t sadb_x_policy_id; u_int32_t sadb_x_policy_reserved2; }; -CTASSERT(sizeof(struct sadb_x_policy) == 16); +_Static_assert(sizeof(struct sadb_x_policy) == 16, "struct size mismatch"); /* * When policy_type == IPSEC, it is followed by some of @@ -267,7 +265,7 @@ struct sadb_x_nat_t_type { u_int8_t sadb_x_nat_t_type_type; u_int8_t sadb_x_nat_t_type_reserved[3]; }; -CTASSERT(sizeof(struct sadb_x_nat_t_type) == 8); +_Static_assert(sizeof(struct sadb_x_nat_t_type) == 8, "struct size mismatch"); /* NAT-Traversal source or destination port. */ struct sadb_x_nat_t_port { @@ -276,7 +274,7 @@ struct sadb_x_nat_t_port { u_int16_t sadb_x_nat_t_port_port; u_int16_t sadb_x_nat_t_port_reserved; }; -CTASSERT(sizeof(struct sadb_x_nat_t_port) == 8); +_Static_assert(sizeof(struct sadb_x_nat_t_port) == 8, "struct size mismatch"); /* ESP fragmentation size. */ struct sadb_x_nat_t_frag { @@ -285,7 +283,7 @@ struct sadb_x_nat_t_frag { u_int16_t sadb_x_nat_t_frag_fraglen; u_int16_t sadb_x_nat_t_frag_reserved; }; -CTASSERT(sizeof(struct sadb_x_nat_t_frag) == 8); +_Static_assert(sizeof(struct sadb_x_nat_t_frag) == 8, "struct size mismatch"); #define SADB_EXT_RESERVED 0 |