From patchwork Tue Mar 22 23:17:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ben@skyportsystems.com X-Patchwork-Id: 601081 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3qV89r6Sc0z9sBf for ; Wed, 23 Mar 2016 10:32:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=skyportsystems.com header.i=@skyportsystems.com header.b=iRNIvZBW; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 806CE10655; Tue, 22 Mar 2016 16:32:12 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 260E410655 for ; Tue, 22 Mar 2016 16:32:11 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id A0FA2420329 for ; Tue, 22 Mar 2016 17:32:10 -0600 (MDT) X-ASG-Debug-ID: 1458688684-09eadd116003e40001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar5.cudamail.com with ESMTP id P8RLOeJfS8YAPGe6 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Mar 2016 17:18:04 -0600 (MDT) X-Barracuda-Envelope-From: ben@skyportsystems.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mail-pf0-f174.google.com) (209.85.192.174) by mx3-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 22 Mar 2016 23:18:04 -0000 Received-SPF: pass (mx3-pf2.cudamail.com: SPF record at _netblocks.google.com designates 209.85.192.174 as permitted sender) X-Barracuda-RBL-Trusted-Forwarder: 209.85.192.174 Received: by mail-pf0-f174.google.com with SMTP id x3so330009818pfb.1 for ; Tue, 22 Mar 2016 16:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skyportsystems.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=1GkU6fNF4tGfg7jpMc1Jc39Bej6gwM57oQz8MO4qUwk=; b=iRNIvZBWCHpkkJCwr664ZnmtLHnCsLkjmCGiMPUutRFMtx9Y6qC0rIIDQ4jjeFvIQ1 Dh0WpuiwuvztHXRynVLl53wttbnqw5pMM6IdERY0qSiSrYrQiiPwDzl6nS18AZ6Oe3w9 i4nHKqvhkjVCt49rgBKvQo/P5BW4B+uV3BmzY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=1GkU6fNF4tGfg7jpMc1Jc39Bej6gwM57oQz8MO4qUwk=; b=I4zZrebxNP8Nvb+FHRUJK0oUfRoijh7qgKJYnF1I8c2yERbSG/t6bMfRGIww8tQN9c vVZAHqNUle0ZwB4eWhAVnyOcEqii/gYmZnC4rCYFgXy90UZwYLqQWf/kX927VQwC851L kUmapNBKSLNhz0yR/kTWZanilaiPOqnXUrjLXSJ9zQa+vWGD5sCdd43xnSLXKZmHzzAZ 0OUDj1yyg+2q0VgebHl5XYC2b8vajXXSnCabx+ycreej3JxzT3q2DzDO5CgdAB/41FLJ 9f60XktODkFnV7/5luhW6Kq6iOGpLzHqfDGs3H796Stt0TR+9xkbDQxWEDyLWZ+8GK9A fuNg== X-Gm-Message-State: AD7BkJI3c3xOl85Zcid5zg84OTTAUn5N0cv+fPzQ6apNfFzPYyaL7rUSfaOyQ/10YjwuLDWR X-Received: by 10.66.55.6 with SMTP id n6mr58683563pap.35.1458688684046; Tue, 22 Mar 2016 16:18:04 -0700 (PDT) Received: from Arrow.corp.skyportsystems.com (67-207-112-138.static.wiline.com. [67.207.112.138]) by smtp.gmail.com with ESMTPSA id 9sm50729385pft.44.2016.03.22.16.18.03 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 22 Mar 2016 16:18:03 -0700 (PDT) X-CudaMail-Envelope-Sender: ben@skyportsystems.com X-Barracuda-Apparent-Source-IP: 67.207.112.138 From: ben@skyportsystems.com To: dev@openvswitch.org X-CudaMail-MID: CM-V2-321069737 X-CudaMail-DTE: 032216 X-CudaMail-Originating-IP: 209.85.192.174 Date: Tue, 22 Mar 2016 16:17:37 -0700 X-ASG-Orig-Subj: [##CM-V2-321069737##][PATCH v4 06/22] Move BLDASSERT macros to compiler header file Message-Id: <91b7692cdcdd133135e2ac03536293bc62bd5586.1458688105.git.ben@skyportsystems.com> X-Mailer: git-send-email 2.5.4 (Apple Git-61) In-Reply-To: References: In-Reply-To: References: X-GBUdb-Analysis: 0, 209.85.192.174, Ugly c=0.437809 p=-0.428571 Source Normal X-MessageSniffer-Rules: 0-0-0-8599-c X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1458688684 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, DKIM_SIGNED, NO_REAL_NAME, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.28069 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 NO_REAL_NAME From: does not include a real name 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: Ben Warren Subject: [ovs-dev] [PATCH v4 06/22] Move BLDASSERT macros to compiler header file X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" From: Ben Warren Signed-off-by: Ben Warren --- include/openvswitch/compiler.h | 30 ++++++++++++++++++++++++++++++ lib/util.h | 28 ---------------------------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/include/openvswitch/compiler.h b/include/openvswitch/compiler.h index 60c408b..1d3af9f 100644 --- a/include/openvswitch/compiler.h +++ b/include/openvswitch/compiler.h @@ -228,4 +228,34 @@ #define OVS_PREFETCH_WRITE(addr) #endif +/* Formerly in lib/util.h */ +#ifdef __CHECKER__ +#define BUILD_ASSERT(EXPR) ((void) 0) +#define BUILD_ASSERT_DECL(EXPR) extern int (*build_assert(void))[1] +#elif !defined(__cplusplus) +/* Build-time assertion building block. */ +#define BUILD_ASSERT__(EXPR) \ + sizeof(struct { unsigned int build_assert_failed : (EXPR) ? 1 : -1; }) + +/* Build-time assertion for use in a statement context. */ +#define BUILD_ASSERT(EXPR) (void) BUILD_ASSERT__(EXPR) + +/* Build-time assertion for use in a declaration context. */ +#define BUILD_ASSERT_DECL(EXPR) \ + extern int (*build_assert(void))[BUILD_ASSERT__(EXPR)] +#else /* __cplusplus */ +#include +#define BUILD_ASSERT BOOST_STATIC_ASSERT +#define BUILD_ASSERT_DECL BOOST_STATIC_ASSERT +#endif /* __cplusplus */ + +#ifdef __GNUC__ +#define BUILD_ASSERT_GCCONLY(EXPR) BUILD_ASSERT(EXPR) +#define BUILD_ASSERT_DECL_GCCONLY(EXPR) BUILD_ASSERT_DECL(EXPR) +#else +#define BUILD_ASSERT_GCCONLY(EXPR) ((void) 0) +#define BUILD_ASSERT_DECL_GCCONLY(EXPR) ((void) 0) +#endif + + #endif /* compiler.h */ diff --git a/lib/util.h b/lib/util.h index df545fe..41c5ea6 100644 --- a/lib/util.h +++ b/lib/util.h @@ -39,34 +39,6 @@ #endif #endif -#ifdef __CHECKER__ -#define BUILD_ASSERT(EXPR) ((void) 0) -#define BUILD_ASSERT_DECL(EXPR) extern int (*build_assert(void))[1] -#elif !defined(__cplusplus) -/* Build-time assertion building block. */ -#define BUILD_ASSERT__(EXPR) \ - sizeof(struct { unsigned int build_assert_failed : (EXPR) ? 1 : -1; }) - -/* Build-time assertion for use in a statement context. */ -#define BUILD_ASSERT(EXPR) (void) BUILD_ASSERT__(EXPR) - -/* Build-time assertion for use in a declaration context. */ -#define BUILD_ASSERT_DECL(EXPR) \ - extern int (*build_assert(void))[BUILD_ASSERT__(EXPR)] -#else /* __cplusplus */ -#include -#define BUILD_ASSERT BOOST_STATIC_ASSERT -#define BUILD_ASSERT_DECL BOOST_STATIC_ASSERT -#endif /* __cplusplus */ - -#ifdef __GNUC__ -#define BUILD_ASSERT_GCCONLY(EXPR) BUILD_ASSERT(EXPR) -#define BUILD_ASSERT_DECL_GCCONLY(EXPR) BUILD_ASSERT_DECL(EXPR) -#else -#define BUILD_ASSERT_GCCONLY(EXPR) ((void) 0) -#define BUILD_ASSERT_DECL_GCCONLY(EXPR) ((void) 0) -#endif - extern char *program_name; #define __ARRAY_SIZE_NOCHECK(ARRAY) (sizeof(ARRAY) / sizeof((ARRAY)[0]))