From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8C06945E6F; Wed, 11 Dec 2024 03:07:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 871A14066C; Wed, 11 Dec 2024 03:06:27 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id BF65240612 for ; Wed, 11 Dec 2024 03:06:16 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 8D4732047231; Tue, 10 Dec 2024 18:06:15 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8D4732047231 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1733882775; bh=bI3pr7nU4qLOsE2B4Phqk+KOfgj9t0HEztH5qmDS5dw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iodpyY2y+sYaug67QhiFgLmaLJ5cqOMrsxf/xTY2XRw3BpcGsfM8KRqUA12Q1+2hN 8sP3zjnSpxZXwI4lKFhk/n6IKVMTyuqzo4xU31OI5JZe3okE4c8iO2y1XAroFI6DRe WLmrSa92gyyCdZk115JbBMaVBu4nsTmmXdFnGwlU= From: Andre Muezerie To: Ashish Gupta , Fan Zhang , Sunila Sahu Cc: dev@dpdk.org, Andre Muezerie Subject: [PATCH 08/21] drivers/compress: use portable variadic macros Date: Tue, 10 Dec 2024 18:05:38 -0800 Message-Id: <1733882751-29598-9-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1733882751-29598-1-git-send-email-andremue@linux.microsoft.com> References: <1733882751-29598-1-git-send-email-andremue@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Many places are using a GCC extension related to variadic macros, where a name prepends the ellipsis. This results in a warning like the one below when compiling the code with MSVC: app\test-pmd\testpmd.h(1314): error C2608: invalid token '...' in macro parameter list Variadic macros became a standard part of the C language with C99. GCC, Clang and MSVC handle them properly. The fix is to remove the prefix name (args... becomes ...) and use __VA_ARGS__. Signed-off-by: Andre Muezerie --- drivers/compress/octeontx/otx_zip.h | 8 ++++---- drivers/compress/zlib/zlib_pmd_private.h | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/compress/octeontx/otx_zip.h b/drivers/compress/octeontx/otx_zip.h index bf09e2f58c..6265664ead 100644 --- a/drivers/compress/octeontx/otx_zip.h +++ b/drivers/compress/octeontx/otx_zip.h @@ -80,10 +80,10 @@ extern int octtx_zip_logtype_driver; #define ZIP_PMD_LOG(level, ...) \ RTE_LOG_LINE_PREFIX(level, OCTTX_ZIP_DRIVER, "%s(): ", __func__, __VA_ARGS__) -#define ZIP_PMD_INFO(fmt, args...) \ - ZIP_PMD_LOG(INFO, fmt, ## args) -#define ZIP_PMD_ERR(fmt, args...) \ - ZIP_PMD_LOG(ERR, fmt, ## args) +#define ZIP_PMD_INFO(fmt, ...) \ + ZIP_PMD_LOG(INFO, fmt, ## __VA_ARGS__) +#define ZIP_PMD_ERR(fmt, ...) \ + ZIP_PMD_LOG(ERR, fmt, ## __VA_ARGS__) /* resources required to process stream */ enum NUM_BUFS_PER_STREAM { diff --git a/drivers/compress/zlib/zlib_pmd_private.h b/drivers/compress/zlib/zlib_pmd_private.h index 7f6a57c6c5..fd8c4c55a4 100644 --- a/drivers/compress/zlib/zlib_pmd_private.h +++ b/drivers/compress/zlib/zlib_pmd_private.h @@ -19,12 +19,12 @@ extern int zlib_logtype_driver; #define ZLIB_PMD_LOG(level, ...) \ RTE_LOG_LINE_PREFIX(level, ZLIB_DRIVER, "%s(): ", __func__, __VA_ARGS__) -#define ZLIB_PMD_INFO(fmt, args...) \ - ZLIB_PMD_LOG(INFO, fmt, ## args) -#define ZLIB_PMD_ERR(fmt, args...) \ - ZLIB_PMD_LOG(ERR, fmt, ## args) -#define ZLIB_PMD_WARN(fmt, args...) \ - ZLIB_PMD_LOG(WARNING, fmt, ## args) +#define ZLIB_PMD_INFO(fmt, ...) \ + ZLIB_PMD_LOG(INFO, fmt, ## __VA_ARGS__) +#define ZLIB_PMD_ERR(fmt, ...) \ + ZLIB_PMD_LOG(ERR, fmt, ## __VA_ARGS__) +#define ZLIB_PMD_WARN(fmt, ...) \ + ZLIB_PMD_LOG(WARNING, fmt, ## __VA_ARGS__) struct zlib_private { struct rte_mempool *mp; -- 2.47.0.vfs.0.3