From owner-svn-src-all@freebsd.org Sun Aug 2 00:15:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4F339B19CF; Sun, 2 Aug 2015 00:15:53 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2C8C1FD3; Sun, 2 Aug 2015 00:15:53 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720FrlQ018930; Sun, 2 Aug 2015 00:15:53 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720Fr6R018929; Sun, 2 Aug 2015 00:15:53 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201508020015.t720Fr6R018929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sun, 2 Aug 2015 00:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286168 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 00:15:54 -0000 Author: jmg Date: Sun Aug 2 00:15:52 2015 New Revision: 286168 URL: https://svnweb.freebsd.org/changeset/base/286168 Log: 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 Modified: head/sys/net/pfkeyv2.h Modified: head/sys/net/pfkeyv2.h ============================================================================== --- head/sys/net/pfkeyv2.h Sun Aug 2 00:11:56 2015 (r286167) +++ head/sys/net/pfkeyv2.h Sun Aug 2 00:15:52 2015 (r286168) @@ -39,9 +39,7 @@ #ifndef _NET_PFKEYV2_H_ #define _NET_PFKEYV2_H_ -#ifndef _KERNEL -#define CTASSERT(x) struct __thisisjustnothing; -#endif +#include /* 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