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 8519C45E33; Wed, 4 Dec 2024 22:41:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 85EBB40F16; Wed, 4 Dec 2024 22:41:18 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id EBAF44026A for ; Wed, 4 Dec 2024 22:41:10 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id A5C6920CECB3; Wed, 4 Dec 2024 13:41:09 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A5C6920CECB3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1733348469; bh=Uti95YyLsuUr3FSkpYzZ5Nv5ifNdbYDXqV2XtlCjf9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hQpdjprlshrssBKSimWF2+CZqzJEARlpFbvERu2Bl9smcQKx1H6nrktG3QVlsbFXV 7YsYyY6VSRYLxyk+U4kTFzpq5deq+WIqPcaPRn8ypm4hE1mCEsmLe+mFh03cHmcw6Q yLwivBfu2T1eoQzEhHBrpLNnuaRXrFLO7fltWLiY= From: Andre Muezerie To: dev@dpdk.org Cc: Andre Muezerie Subject: [PATCH v2 6/6] lib/mldev: eliminate dependency on non-portable __SIZEOF_LONG__ Date: Wed, 4 Dec 2024 13:41:06 -0800 Message-Id: <1733348466-16057-7-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1733348466-16057-1-git-send-email-andremue@linux.microsoft.com> References: <1733342995-3722-2-git-send-email-andremue@linux.microsoft.com> <1733348466-16057-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 Macro __SIZEOF_LONG__ is not standardized and MSVC does not define it. Therefore the errors below are seen with MSVC: ../lib/mldev/mldev_utils_scalar.c(465): error C2065: '__SIZEOF_LONG__': undeclared identifier ../lib/mldev/mldev_utils_scalar.c(478): error C2051: case expression not constant ../lib/mldev/mldev_utils_scalar_bfloat16.c(33): error C2065: '__SIZEOF_LONG__': undeclared identifier ../lib/mldev/mldev_utils_scalar_bfloat16.c(49): error C2051: case expression not constant Turns out that the places where __SIZEOF_LONG__ is currently being used can equally well use sizeof(long) instead. Signed-off-by: Andre Muezerie --- lib/mldev/mldev_utils_scalar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mldev/mldev_utils_scalar.h b/lib/mldev/mldev_utils_scalar.h index 57e66ddb60..d12e358fb5 100644 --- a/lib/mldev/mldev_utils_scalar.h +++ b/lib/mldev/mldev_utils_scalar.h @@ -13,7 +13,7 @@ #endif #ifndef BITS_PER_LONG -#define BITS_PER_LONG (__SIZEOF_LONG__ * 8) +#define BITS_PER_LONG (sizeof(long) * 8) #endif #ifndef GENMASK_U32 -- 2.47.0.vfs.0.3