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 A5E8B42DDB; Mon, 10 Jul 2023 23:29:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65C14410F1; Mon, 10 Jul 2023 23:29:52 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 05DEC40698 for ; Mon, 10 Jul 2023 23:29:49 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 3C17421C4253; Mon, 10 Jul 2023 14:29:49 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3C17421C4253 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1689024589; bh=ZXGGcm8oUgc2jfuTBX9YPY0MWnpdG6tLOZyax8hWvj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hmMs+3u3IPqvroC7yM2BbrY9htLZ0fwj6C4dx0YRftzmn0+v9kZOTLCBQ82p9Yq5j WE2nz8oNOo0b5OU8+vnjC050WbuyhBZuojrRBuvME/cdy8tX81pOcgrdmo9JEGQrQk R3YzHaHMC/yhCuc99IhmWz9Imy2hbbqN64GrKrKc= From: Tyler Retzlaff To: dev@dpdk.org Cc: david.marchand@redhat.com, thomas@monjalon.net, Tyler Retzlaff Subject: [PATCH] eal: provide per lcore macros for MSVC Date: Mon, 10 Jul 2023 14:29:45 -0700 Message-Id: <1689024585-17303-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1689024585-17303-1-git-send-email-roretzla@linux.microsoft.com> References: <1689024585-17303-1-git-send-email-roretzla@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 Provide per lcore macros that use __declspec(thread) and uses C23 typeof. Signed-off-by: Tyler Retzlaff --- lib/eal/include/rte_per_lcore.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/eal/include/rte_per_lcore.h b/lib/eal/include/rte_per_lcore.h index eaedf0c..4ef8905 100644 --- a/lib/eal/include/rte_per_lcore.h +++ b/lib/eal/include/rte_per_lcore.h @@ -24,6 +24,7 @@ #include +#ifndef RTE_TOOLCHAIN_MSVC /** * Macro to define a per lcore variable "var" of type "type", don't * use keywords like "static" or "volatile" in type, just prefix the @@ -37,6 +38,13 @@ */ #define RTE_DECLARE_PER_LCORE(type, name) \ extern __thread __typeof__(type) per_lcore_##name +#else +#define RTE_DEFINE_PER_LCORE(type, name) \ + __declspec(thread) typeof(type) per_lcore_##name + +#define RTE_DECLARE_PER_LCORE(type, name) \ + extern __declspec(thread) typeof(type) per_lcore_##name +#endif /** * Read/write the per-lcore variable value -- 1.8.3.1