From patchwork Wed Jan 25 01:46:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 92399 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1999001qgi; Tue, 24 Jan 2017 17:46:39 -0800 (PST) X-Received: by 10.55.149.197 with SMTP id x188mr23241310qkd.70.1485308799046; Tue, 24 Jan 2017 17:46:39 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 89si14437239qth.16.2017.01.24.17.46.38; Tue, 24 Jan 2017 17:46:39 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9347562DC2; Wed, 25 Jan 2017 01:46:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 64A9F62DBA; Wed, 25 Jan 2017 01:46:34 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 8987E62DBC; Wed, 25 Jan 2017 01:46:32 +0000 (UTC) Received: from mail-ot0-f175.google.com (mail-ot0-f175.google.com [74.125.82.175]) by lists.linaro.org (Postfix) with ESMTPS id C122B62DB6 for ; Wed, 25 Jan 2017 01:46:30 +0000 (UTC) Received: by mail-ot0-f175.google.com with SMTP id 65so141673388otq.2 for ; Tue, 24 Jan 2017 17:46:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5oKCa8WIW+ladqkSGRyKazzidiqxMIk3ktmng9Eqiwc=; b=eZCC0/kcFsdI84MQK/2sj5t5VnozcNO+1ikXXKv2jagWlhcPjnBF1FWtR8b2TZp9/V VoybGfCtc/3XEgRWOrPVzxFQ6VFZC7KIPMeiK9Q6ddXgQeKI9I6dltwbV/K0a+UQJpFu KsnFSLURlpipsEBZn/gxkRZ+gi61UR5Od2Gs+Axw92pV1/LIpLZyOCmxMYcYEFpPKeqY oCWiJxzBkpfBY832tEZcMUHFxLXuOqioZaA7snnOZDN1kkGmS2dLFHueLTjUcjJWPhX3 i1mJG83nVo4wt6kdI0tRl+9VYmQI/psXhg6OgT5GssYo55mVriHAQgVnNh1WCu6JajL6 sxBA== X-Gm-Message-State: AIkVDXLaNqTo5SGuy3Yn/hxS2Z9RNqUJaLus2FaRDlqKNyZqcYtCcZogAdH7iBYuis9H7QKyKkM= X-Received: by 10.157.40.22 with SMTP id m22mr17261523otb.210.1485308790205; Tue, 24 Jan 2017 17:46:30 -0800 (PST) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id o67sm1254691oif.11.2017.01.24.17.46.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 17:46:29 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 24 Jan 2017 19:46:26 -0600 Message-Id: <20170125014626.28667-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.9.3 Subject: [lng-odp] [PATCH] linux-generic: debug: enable helper use from c++ programs X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" The ODP_STATIC_ASSERT() macro expands to _Static_assert(), however when used in C++ programs this needs to expand to static_assert(). This resolves Bug https://bugs.linaro.org/show_bug.cgi?id=2852 Signed-off-by: Bill Fischofer --- platform/linux-generic/include/odp/api/debug.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.9.3 diff --git a/platform/linux-generic/include/odp/api/debug.h b/platform/linux-generic/include/odp/api/debug.h index 7db1433..19659a9 100644 --- a/platform/linux-generic/include/odp/api/debug.h +++ b/platform/linux-generic/include/odp/api/debug.h @@ -39,9 +39,11 @@ extern "C" { * if condition 'cond' is false. Macro definition is empty when compiler is not * supported or the compiler does not support static assertion. */ -#define ODP_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg) +#ifndef __cplusplus +#define ODP_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg) -#ifdef __cplusplus +#else +#define ODP_STATIC_ASSERT(cond, msg) static_assert(cond, msg) } #endif