From patchwork Thu Mar 3 18:20:48 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: 591546 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 93E8D140C5F for ; Fri, 4 Mar 2016 05:22:39 +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=560a/kFV; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 6FF4222C3CC; Thu, 3 Mar 2016 10:21:24 -0800 (PST) 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 4581A22C3BD for ; Thu, 3 Mar 2016 10:21:23 -0800 (PST) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id C743A4202FA for ; Thu, 3 Mar 2016 11:21:22 -0700 (MST) X-ASG-Debug-ID: 1457029282-09eadd2b1047a4e0001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar5.cudamail.com with ESMTP id IEUmeGJe3hf4hZks (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 03 Mar 2016 11:21:22 -0700 (MST) X-Barracuda-Envelope-From: ben@skyportsystems.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mail-pf0-f182.google.com) (209.85.192.182) by mx3-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 3 Mar 2016 18:21:21 -0000 Received-SPF: pass (mx3-pf2.cudamail.com: SPF record at _netblocks.google.com designates 209.85.192.182 as permitted sender) X-Barracuda-RBL-Trusted-Forwarder: 209.85.192.182 Received: by mail-pf0-f182.google.com with SMTP id 63so19146322pfe.3 for ; Thu, 03 Mar 2016 10:21:21 -0800 (PST) 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=4ANqZSCrAOF1D5hULMI/VZnk9cslrY0C8oND5MSksi0=; b=560a/kFVgM9pmzt0q55h1x6yXO26rZYaBco4BSEQWt4vPAbZmree86OhE2/CyAjz3m U0kevsrHjPRbbRGbG9XMqjx11eQni51sZXgbb8C7jhCGm6idCuApSwT2dcQGrM+l9GjN 3IYz0Vy4+pDPxqn0WQiQWOwpxkGEvbShk6q0w= 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=4ANqZSCrAOF1D5hULMI/VZnk9cslrY0C8oND5MSksi0=; b=gVhQHs/DBspPnDEWUyqOS/tecjumC8/+WbXf2hWoivcfYuZwCCQK54QtCVFROWFEH5 57zlDC1/JAKmIbFz5k9gfv1/8u2vNwfwUCkSV1MuJQA9krR69Tj24W0WlhXG2GyoEy4Y jpeE6V5QGgnI8Jt+qITBRIUFPgcOe4C8vGpzcSE+1KX2KypwY9aHIvgJhDcLDRcCOD92 pnZzf2GvqR+MG7O6cvlZHMBWHf5d+dddgC2ZMdUa6raOqpn5sZ6owHJ3wOnJlxgVY0X5 nkwSxD7d6cZQ9SQnlpjJJZhM5G/f/OqSXgNzZG6D8+2y2x8kb1SSTn9+hfam4PJz0iMB QfMw== X-Gm-Message-State: AD7BkJLvAeS8g/JzaMgV2/FC7hVM/zNxmW+3LS4l4KRqtNnjFDR02QM7vPtGFU3sRUm8iLsn X-Received: by 10.98.68.73 with SMTP id r70mr5734007pfa.136.1457029281376; Thu, 03 Mar 2016 10:21:21 -0800 (PST) Received: from Arrow.corp.skyportsystems.com (67-207-112-138.static.wiline.com. [67.207.112.138]) by smtp.gmail.com with ESMTPSA id g25sm62149841pfg.35.2016.03.03.10.21.20 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 03 Mar 2016 10:21:20 -0800 (PST) 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-302038134 X-CudaMail-DTE: 030316 X-CudaMail-Originating-IP: 209.85.192.182 Date: Thu, 3 Mar 2016 10:20:48 -0800 X-ASG-Orig-Subj: [##CM-V2-302038134##][PATCH v2 08/23] Move BLDASSERT macros to compiler header file Message-Id: 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.182, Ugly c=0.36638 p=-0.257143 Source Normal X-MessageSniffer-Rules: 0-0-0-8594-c X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1457029282 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.27542 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 v2 08/23] 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 cd71360..8111039 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]))