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 D5CC243D0A; Wed, 20 Mar 2024 22:33:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 541FE42E2D; Wed, 20 Mar 2024 22:33:42 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 3DEE242D80 for ; Wed, 20 Mar 2024 22:33:40 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 85C1720B74C1; Wed, 20 Mar 2024 14:33:39 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 85C1720B74C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1710970419; bh=AoxkIcz98u0FQ8JOWwLgH8q2jdgzPIGO2CL1CCXocu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=idE/VIhte7b//1Xty0ytmLVT7qm29PBcJxJwJn5xcu7rwuON8M1BRMOLEaz2ikkxV 0vNDNjtR2zQB1Ewv13GChjkpWZRpxhgaY2bLBvUnQmjfQQaXbROh9XhJ/SlIceh5A3 iTMvTEINIgODNEmpnPbhim4esHP2lLG4vFrQ2ibQ= From: Tyler Retzlaff To: dev@dpdk.org Cc: =?UTF-8?q?Morten=20Br=C3=B8rup?= , Andrew Rybchenko , Tyler Retzlaff Subject: [PATCH 1/2] eal: provide macro for GCC builtin constant intrinsic Date: Wed, 20 Mar 2024 14:33:35 -0700 Message-Id: <1710970416-27841-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710970416-27841-1-git-send-email-roretzla@linux.microsoft.com> References: <1710970416-27841-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 MSVC does not have a __builtin_constant_p intrinsic so provide __rte_constant(e) that expands false for MSVC and to the intrinsic for GCC. Signed-off-by: Tyler Retzlaff --- lib/eal/include/rte_common.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h index 298a5c6..d520be6 100644 --- a/lib/eal/include/rte_common.h +++ b/lib/eal/include/rte_common.h @@ -44,6 +44,12 @@ #endif #endif +#ifdef RTE_TOOLCHAIN_MSVC +#define __rte_constant(e) 0 +#else +#define __rte_constant(e) __extension__(__builtin_constant_p(e)) +#endif + /* * RTE_TOOLCHAIN_GCC is defined if the target is built with GCC, * while a host application (like pmdinfogen) may have another compiler. -- 1.8.3.1