From patchwork Wed Jul 5 14:00:20 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: 107081 Delivered-To: patch@linaro.org Received: by 10.182.135.102 with SMTP id pr6csp884023obb; Wed, 5 Jul 2017 07:06:39 -0700 (PDT) X-Received: by 10.237.60.19 with SMTP id t19mr52693558qte.206.1499263598956; Wed, 05 Jul 2017 07:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499263598; cv=none; d=google.com; s=arc-20160816; b=WqqS1NYVGpUT0e9MUvDH5MIK2thky9G3SrXcJf+AJTjIKFHIgxWqvXHvP4to4d7LH+ PWe9GZIjDfDU7xRMQXjtfwt1sAUQQPAD8UhhqTE39VxNVKb8KH3r9v2Gjwqaxw8NpaCr PUmzBfhuXGnBalvrJMkwlEsgN2D3udTPyUyGV6PVQs8812KVdQ0+BPDeXFHCZuwcPwlW CWDJUOYxvmrlrlsDCS0yEl/SuF+ilaG9MPRn9OncWibKugwwha2MXUK0zyBTzt3UxLYj ZjBUjSOFRnzAGPJf7MuYnZQHS+qzoUOgbwE08FUAjH+h93pGsD6LkY0c2Fx6XLmcGw2M VIcQ== 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=ctHv8asEDfs4MbAhbQW2e2nwpH4kSwRFfDhFm0iouuA=; b=xol8zCT/+vO3KscmOX4s4GZ90pzC86x92OojtvVMsN4WZ7vuzqmX9yDjZfdSL/r9ax Zw2WJAsNZxRqEQY8eP8rT9ozUNWhI16GNLB9LavaCwMc4eHtVuHWhUvPHVDo2EO4PO3W A/ZRVv6Op9TCdY1FBd9fLEtVjqs3QtJrLzuPA6uPQ0ICRZOK/HW1oRb6XK+7IDeW4C1X jQNTmVGT3GUQRYXgh0BHwbkRjzIGFNcVscXC936LGq9JXoy73AsrEpPb+SXoglSJ5DMJ p8ljo4LU7fKndHPiQ0zgYfK8dGH76m156bN/t0rOxX+TbqlB/WJ8nYnVJA9Q+RUJImlX MOeQ== 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 z4si14965074qtz.117.2017.07.05.07.06.37; Wed, 05 Jul 2017 07:06:38 -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 CFD1E607A3; Wed, 5 Jul 2017 14:06:37 +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 8B11060D70; Wed, 5 Jul 2017 14:01:40 +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 61FC460816; Wed, 5 Jul 2017 14:01:12 +0000 (UTC) Received: from forward3j.cmail.yandex.net (forward3j.cmail.yandex.net [5.255.227.21]) by lists.linaro.org (Postfix) with ESMTPS id DCEF060D2E for ; Wed, 5 Jul 2017 14:00:43 +0000 (UTC) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [5.45.198.129]) by forward3j.cmail.yandex.net (Yandex) with ESMTP id 7729D21042 for ; Wed, 5 Jul 2017 17:00:42 +0300 (MSK) Received: from smtp4j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4j.mail.yandex.net (Yandex) with ESMTP id 3C9B33241117 for ; Wed, 5 Jul 2017 17:00:39 +0300 (MSK) Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id SKW8niBPOU-0cES2VMg; Wed, 05 Jul 2017 17:00:38 +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: Wed, 5 Jul 2017 17:00:20 +0300 Message-Id: <1499263226-5288-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499263226-5288-1-git-send-email-odpbot@yandex.ru> References: <1499263226-5288-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 64 Subject: [lng-odp] [PATCH API-NEXT v8 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: 00a21c6dce65a30c8250db59a42a43c658e8ca1b ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6 **/ 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 */