From patchwork Wed Feb 28 18:47:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 137455 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A288843C28; Wed, 28 Feb 2024 19:48:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B24F042F11; Wed, 28 Feb 2024 19:48:03 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 503E54003C for ; Wed, 28 Feb 2024 19:47:58 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 8C35220B74C1; Wed, 28 Feb 2024 10:47:57 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8C35220B74C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709146077; bh=5m2t3aU+mt7HgTdWTwCRj6effQsOWh+FVOhNJd0iWzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g+DL2xyuU33CusTUEIyBcFgqQi/rR0qFbOjwtwesD5d/uuc5oi/uCKkh8obLDdGd8 ImnfbWN7jNAI5C0Zg5vNgCgpvTehuIny7Bi1D0nDR6lh5utkxUsSHps14lZVJuzWZl ZX/jzX2j/wvxbudqsnhpmpkaNVGW8KpoKMCWLi28= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Honnappa Nagarahalli , Vladimir Medvedkin , mb@smartsharesystems.com, Tyler Retzlaff Subject: [PATCH v2 1/3] eal: add rte pure attribute macro Date: Wed, 28 Feb 2024 10:47:54 -0800 Message-Id: <1709146076-22254-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709146076-22254-1-git-send-email-roretzla@linux.microsoft.com> References: <1709075273-6885-1-git-send-email-roretzla@linux.microsoft.com> <1709146076-22254-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 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 Add __rte_pure for __attribute__((pure)) to permit elimination of direct use of __attribute__((pure)) in other libs. Signed-off-by: Tyler Retzlaff Reviewed-by: Morten Brørup --- lib/eal/include/rte_common.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h index 1cc1222..354b149 100644 --- a/lib/eal/include/rte_common.h +++ b/lib/eal/include/rte_common.h @@ -125,6 +125,15 @@ #define __rte_weak __attribute__((__weak__)) /** + * Mark a function to be pure. + */ +#ifdef RTE_TOOLCHAIN_MSVC +#define __rte_pure +#else +#define __rte_pure __attribute__((pure)) +#endif + +/** * Force symbol to be generated even if it appears to be unused. */ #ifdef RTE_TOOLCHAIN_MSVC