From patchwork Tue Jul 11 14:00:23 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: 107391 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4941190qge; Tue, 11 Jul 2017 07:22:25 -0700 (PDT) X-Received: by 10.55.181.71 with SMTP id e68mr168041qkf.91.1499782945254; Tue, 11 Jul 2017 07:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499782945; cv=none; d=google.com; s=arc-20160816; b=apGqltKh5jBruv6k9PFGmUwjol1U6/PoqCCGSXuK13txTbiMkbX+K6KrIiXb7HAQfc S0IMWgcw0urXRS4TgcnOeVLSbhBHY720Lgfoyerfto2kLMHaOefrZZavzuorejNdRXuu 8Pt+uziBDVJmZ6q1+KLcgvfxZyF1k2GCKpOhJ6Xs0P12t9NZpkWS7D0VkowFH6ZXh7dP oO3ECwIJR5r9HTI1FbpPbEZgSiVqvcieOyDfI7cQw9EA5ySHqEruMdqfpA/tuZtzAJzI vc31nlMi9hOouexcHW5W5pS3VDJDMcJobmwpdIGEi0+lU90c2FwXYcrzVZ/wzP/5RGzx qfFQ== 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=otoWp6aw1e57nmbOWtpjI2Xh8wmaa9IxMJcotYrXuxs=; b=BVicnqDzhwWvuILZ5odyPal4spYfCcWZ3hHrmsbiDIfMUURC888589p/VTjB4cQDZ9 eFIvyPGU6uXqOOB1KuAqMnPvK/NtVGWa/F3CMKV7XAjJrv4Ni5Uu/JWagHphwYhY/4Ne 7GE+1ikB64+nf9szBljgP4cfcWCyfwMInKKezb0TEciT0RCXsZcwyTAkpjpuT3enXONA a/x6xIdQCDiSb7a27pG5Zw9tAVUwz3SPC8upMHjc3hVUxJJQGpdoGcbmubAom7Pa6rRO 54cc3VKEeFMxLLUoZaNOoKA+6G1C8xAE9+Cu6Lp3wdGorssoAkGHEx2A6qldVsuIXWqe eh5g== 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 t187si62635qkh.150.2017.07.11.07.22.25; Tue, 11 Jul 2017 07:22:25 -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 EB0A660D83; Tue, 11 Jul 2017 14:22:24 +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 EA0FB60D87; Tue, 11 Jul 2017 14:18:38 +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 CFE0E60D86; Tue, 11 Jul 2017 14:18:28 +0000 (UTC) Received: from forward4j.cmail.yandex.net (forward4j.cmail.yandex.net [5.255.227.22]) by lists.linaro.org (Postfix) with ESMTPS id 0A76D60D42 for ; Tue, 11 Jul 2017 14:14:31 +0000 (UTC) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [95.108.130.60]) by forward4j.cmail.yandex.net (Yandex) with ESMTP id A983221285 for ; Tue, 11 Jul 2017 17:14:29 +0300 (MSK) Received: from smtp2j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2j.mail.yandex.net (Yandex) with ESMTP id DB7BE3EC350B for ; Tue, 11 Jul 2017 17:00:41 +0300 (MSK) Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id OI4ujX4Yll-0eLSwr2U; Tue, 11 Jul 2017 17:00:40 +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, 11 Jul 2017 17:00:23 +0300 Message-Id: <1499781629-30670-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499781629-30670-1-git-send-email-odpbot@yandex.ru> References: <1499781629-30670-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 64 Subject: [lng-odp] [PATCH API-NEXT v9 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: c7718962c6633c80eb71a0400d89c31f11f88045 ** Merge commit sha: 6b4b95ac299d32801f55cf75ba31016675ac1afb **/ 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 */