From patchwork Sat Jul 1 10:00:02 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: 106805 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp3322073qge; Sat, 1 Jul 2017 03:04:40 -0700 (PDT) X-Received: by 10.202.228.8 with SMTP id b8mr3941489oih.223.1498903480229; Sat, 01 Jul 2017 03:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498903480; cv=none; d=google.com; s=arc-20160816; b=ZS6WVOvFHervco17mh9a+C0UdZfJQA/h0LxHHxRSksnvF8Hj2nbbYrq4ftYKcTMita +rrKmm10Cxgt9vKgeDH0xekYxXSUgdKrjVm5yHrXgZwEPWRzpZ4gPe/+Qo0vvM2RnEFs C3eW7T3P+7fRwdCMSPCThlQAG77gY1Jv+vBRq3Ewfym4pnFO4U+36lRc9kBqCuiymMRL YRWiJW1870sREq3Bw+FMPMJ5r4VYKAHqTw8o8vNr1K5TABBK/RG+/A6VCuGdM3PP9QI1 JFQLayThGWQjhmBua6+KRFbutYnRcmlfIiD4hZBweR/dmw8h/JQCAEudqExmgy655q82 gjUQ== 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=ms9FPeT8Bh/nIUXWbYsobZdOVhCUr5q6l22v2iPFv2M=; b=PsXUGbZTTltFK1PKCpti/SE9PsHqCvsaToU5KyNPS8cZrAPK0yoHK1oa7LTx4fqLqf sqt24VTOhNVZbmRdLQZsr1+0xp5ZivihoLbEvxaFu7s85SvXFuPLuTUaxBgzj2I2Cqwh 6goR6ctU53N7Ji6TWJ8TVEQ/EHIDcyw8PfSiJK8px4PghnyFQikbYdTU4ynDOS5657xE prk9kjG9DEBzYA71F1gU8poWbDk7Tgbys5NYZxLhPGdfNJXLFAMX4azZg+r7lt/udVUO bV+Gpa4PrJo8kX5zNFj6M7svPiN5VfOObzw56wJV5/3jNv0PHocoSRnT/mCSkJXRlhek pCbg== 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 c198si7624952oib.24.2017.07.01.03.04.39; Sat, 01 Jul 2017 03: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 A452E608FC; Sat, 1 Jul 2017 10: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 4E24060521; Sat, 1 Jul 2017 10:01:00 +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 E018662CF2; Sat, 1 Jul 2017 10:00:54 +0000 (UTC) Received: from forward4p.cmail.yandex.net (forward4p.cmail.yandex.net [77.88.31.19]) by lists.linaro.org (Postfix) with ESMTPS id 56C0360731 for ; Sat, 1 Jul 2017 10:00:18 +0000 (UTC) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b6:7]) by forward4p.cmail.yandex.net (Yandex) with ESMTP id B6C3220731 for ; Sat, 1 Jul 2017 13:00:15 +0300 (MSK) Received: from smtp2p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2p.mail.yandex.net (Yandex) with ESMTP id 874F81A80057 for ; Sat, 1 Jul 2017 13:00:14 +0300 (MSK) Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id qX4dfs6pfd-0EfGJ7jJ; Sat, 01 Jul 2017 13:00:14 +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: Sat, 1 Jul 2017 13:00:02 +0300 Message-Id: <1498903208-7527-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1498903208-7527-1-git-send-email-odpbot@yandex.ru> References: <1498903208-7527-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 64 Subject: [lng-odp] [PATCH API-NEXT v5 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: 503ae4dbca9c82be6657b05369d23a484ef0cba8 **/ 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 */