From patchwork Tue Jul 4 13:00:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 106970 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp980979qge; Tue, 4 Jul 2017 06:04:40 -0700 (PDT) X-Received: by 10.55.201.142 with SMTP id m14mr45625546qkl.245.1499173480174; Tue, 04 Jul 2017 06:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499173480; cv=none; d=google.com; s=arc-20160816; b=K/joOPFNEIUnAZN+avQye1ak/+diEReb4FtWyDRld9mBR6dGBfjx/G2kXzl1NbT7iy UCmFSUY+8ickgrCa8oLSzYC6mTb+LvTKMjCyhBFdH2eMCtxhkIZDC51w1mgVmXPR5kbi R2KVfDYNPZZkQ8IWYKkDfV9vtSJZXdTgV4ACQNVNG2qacusgmpEyPXXzo7fsDhVnkuIU sFtdcU+bZ5sUCDjWVFbltqmIk8k3Q5obIRzA4BAxGgAU3yrJedVNI2jxivOnW581e6fM GLQJknssAbFKz3OA3tyuJr55qJrCP0rcnIc0OFlLC/rsAod+pbrVJ7i+7weQCL6WhuFb 7IuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=3kKov5IW6VKbZYFHuP31txJsNyCC4+L23PkaiGEQBdY=; b=EX5s7yeomzv7acrEhtH7CzwnKaBeG2EudZTNq/jKnHhmTbIcTnr+fZmmzbvmMbADs8 yC3PpLCI7AA6+FALESDLpSSnACQv4l5DqzqvQ4rd2q26Kto7iWZcMIQQoJgfPNQVjihm ZbWiNh1riEnxm6s+mmmJ3ms6luH4gcQOJM3A5bsiLgkfVXR6l/TT2HDIPOSr2v3DTB+2 Vix4epc99KfA0wFbGJaWDIK4jrT8SkGK+6P1W6v8YJ4H+6EHMZnFZPWrBIDqT4iTQyFo rklnEQTM3WfebzNRXmn7SUDqSz89J/1jf6TH6M1/wocnMK6LtgSPqd9FKzqh3paCkB98 C8Bw== ARC-Authentication-Results: i=1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m15si15753076qtm.325.2017.07.04.06.04.39; Tue, 04 Jul 2017 06:04:40 -0700 (PDT) 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 2A1D760BE6; Tue, 4 Jul 2017 13:04:39 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 7AE066069C; Tue, 4 Jul 2017 13:01:08 +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 29E1A60C17; Tue, 4 Jul 2017 13:01:02 +0000 (UTC) Received: from forward4m.cmail.yandex.net (forward4m.cmail.yandex.net [5.255.216.22]) by lists.linaro.org (Postfix) with ESMTPS id 212CC6068B for ; Tue, 4 Jul 2017 13:00:26 +0000 (UTC) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [95.108.130.59]) by forward4m.cmail.yandex.net (Yandex) with ESMTP id C63972144E for ; Tue, 4 Jul 2017 16:00:24 +0300 (MSK) Received: from smtp1j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1j.mail.yandex.net (Yandex) with ESMTP id C13533C80AAF for ; Tue, 4 Jul 2017 16:00:20 +0300 (MSK) Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id dEbHN6TEiW-0K10WUqX; Tue, 04 Jul 2017 16:00:20 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 4 Jul 2017 16:00:05 +0300 Message-Id: <1499173211-25849-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499173211-25849-1-git-send-email-odpbot@yandex.ru> References: <1499173211-25849-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 64 Subject: [lng-odp] [PATCH API-NEXT v7 4/10] linux-gen: fix ODP_HANDLE_T expansion with c++ if type is compound 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" From: Dmitry Eremin-Solenikov Currently expansion of ODP_HANDLE_T defined in strong_types.h would result in concatenating undercrore with 'type'. If type defined using macro, this can result in underscore being concatenated with macro name, resulting in further errors. Use two-stage ODP_HANDLE_T expansion in C++ case so that macro params are expanded first, before being concatenated with underscore. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 64 (lumag:crypto-packet) ** https://github.com/Linaro/odp/pull/64 ** Patch: https://github.com/Linaro/odp/pull/64.patch ** Base sha: 7a5813042d58598e1c66243d8cfed548302edfc4 ** Merge commit sha: 5c56939323daffaf4835886b0bb75d21bb15c8d6 **/ platform/linux-generic/include/odp/api/plat/strong_types.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/include/odp/api/plat/strong_types.h b/platform/linux-generic/include/odp/api/plat/strong_types.h index a53d7635..2e3070f8 100644 --- a/platform/linux-generic/include/odp/api/plat/strong_types.h +++ b/platform/linux-generic/include/odp/api/plat/strong_types.h @@ -17,7 +17,9 @@ /** Use strong typing for ODP types */ #ifdef __cplusplus -#define ODP_HANDLE_T(type) struct _##type { uint8_t unused_dummy_var; } *type +/* Allow type to be expanded before concatenation with underscore */ +#define _ODP_HANDLE_T(type) struct _##type { uint8_t unused_dummy_var; } *type +#define ODP_HANDLE_T(type) _ODP_HANDLE_T(type) #else #define odp_handle_t struct { uint8_t unused_dummy_var; } * /** C/C++ helper macro for strong typing */