From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965789AbdDSQRv (ORCPT ); Wed, 19 Apr 2017 12:17:51 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:45811 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965548AbdDSQRo (ORCPT ); Wed, 19 Apr 2017 12:17:44 -0400 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , Wang Nan Subject: [PATCH 03/28] tools include: Introduce linux/bug.h, from the kernel sources Date: Wed, 19 Apr 2017 13:16:58 -0300 Message-Id: <20170419161723.21011-4-acme@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170419161723.21011-1-acme@kernel.org> References: <20170419161723.21011-1-acme@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo With just what we will need in the upcoming changesets, the BUILD_BUG_ON_ZERO() definition. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-lw8zg7x6ttwcvqhp90mwe3vo@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/include/linux/bug.h | 10 ++++++++++ tools/perf/MANIFEST | 1 + 2 files changed, 11 insertions(+) create mode 100644 tools/include/linux/bug.h diff --git a/tools/include/linux/bug.h b/tools/include/linux/bug.h new file mode 100644 index 000000000000..8e4a4f49135d --- /dev/null +++ b/tools/include/linux/bug.h @@ -0,0 +1,10 @@ +#ifndef _TOOLS_PERF_LINUX_BUG_H +#define _TOOLS_PERF_LINUX_BUG_H + +/* Force a compilation error if condition is true, but also produce a + result (of value 0 and type size_t), so the expression can be used + e.g. in a structure initializer (or where-ever else comma expressions + aren't permitted). */ +#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) + +#endif /* _TOOLS_PERF_LINUX_BUG_H */ diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST index 89018c7311a4..a29da46d180f 100644 --- a/tools/perf/MANIFEST +++ b/tools/perf/MANIFEST @@ -64,6 +64,7 @@ tools/include/linux/bitops.h tools/include/linux/compiler.h tools/include/linux/compiler-gcc.h tools/include/linux/coresight-pmu.h +tools/include/linux/bug.h tools/include/linux/filter.h tools/include/linux/hash.h tools/include/linux/kernel.h -- 2.9.3