From nobody Sat Sep 05 10:48:42 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hcVSB3D9tz6rLZJ for ; Sat, 05 Sep 2026 10:48:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hcVSB2PB9z3HqF for ; Sat, 05 Sep 2026 10:48:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788605322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Y/LcTTM77SMlR7ozp84wQp2WT1yrBbWc8J8quHCZd0=; b=CmbkJqlz4DEIlQGbC69Iq6FyiaSpHvpkgCnyMxzTIjp25e+kRV2Ap9PMqWoJeJ4GUYTNvT olJakJ+jXy7VSErnzHR35Im05mGGaUqEooP/FlCLx48UdN8LkFmJ1z+jNOi0OiOBlpx43J su5Jo6cXtP2g/WuExm7+lTjvQesHzeRv2YwZcbOYN5wk0626KPs4SRmXeBII5lRV6dySNy z1ZXUHrmag5VwoMDuu+tsU7VCuG3kTop8TwDgyTJEp8UBfagu+FN9FcpONlyBxlhCCAGBS ykveP4gcQ07KhxkgzRThcpI6SNWX3yRyus1TvWWJ0+bZPRtwgjBPg0vJLk9LtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788605322; a=rsa-sha256; cv=none; b=PNkds66yxMmjMqksGjdi13JULSoP17a4PjsDRIfCZrW94N8hcaR1CPX85/wDOXChlM1NZQ 2LysEv6Q75edAfWzYRgDsAa3WLBoGsQNPMCo1vVSzy7duZNAuQ20JdisiTN6fh+UVhmPKD 9XpHu9wnzqRckFFUldeAZNxO8dggHOb2jr6qPOq2Pe3gbAfSWs91xnph16NjC2mhWCMf6a 4CxEDv8KTNOpc0u3X13lEQY1Bps/fFuVBntAegQwR0WD0akjfpF4g+E63avPnJmuuSjGBX 81TVNF5Yf9dnCLAPx6Ih+2rpPBXI0QeimdzQKqyx15Gvfv89y9edpXBPWF+Pwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788605322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Y/LcTTM77SMlR7ozp84wQp2WT1yrBbWc8J8quHCZd0=; b=hiKjEijJkc16a1Vlp2UGk1Z3Ezv6l0pMABWX/bxUj+C0asGL8qC5eQvLk31m/cZTCZ9g0M XI3IRUpFm2iMSAsz5m0JeKgbL8cdVpKuxI3La8S+51hbT6WVSGAZ3M+PcncIc8e1CDb1eF UTkSytDUCvVsl6GXUCcH4AN7Chn9JMGpkpoHzBnRUbkaPkmpDc90Stnkx0hiBrVHTLCNwm xPZtPMsUwCSgga3bVi/wBouPj31Jv26GMt9SLiKPogvGr8bsCEiFZ7rQz3PegZOijaRV+I SZfAkbpbRhgyHySe/Rq7iXPEYz3jYWI5JqvVv5OqqdBampu0RKajmMi5Y1aMtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hcVSB0nCMzjqh for ; Sat, 05 Sep 2026 10:48:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47d2c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 05 Sep 2026 10:48:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Faraz Vahedi Subject: git: 72ed6f9c9dc9 - main - libc: Add WCHAR_WIDTH in as well List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kfv X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72ed6f9c9dc95124cd81158d1c4437484a1b951e Auto-Submitted: auto-generated Date: Sat, 05 Sep 2026 10:48:42 +0000 Message-Id: <6a9bf38a.47d2c.3a794976@gitrepo.freebsd.org> The branch main has been updated by kfv: URL: https://cgit.FreeBSD.org/src/commit/?id=72ed6f9c9dc95124cd81158d1c4437484a1b951e commit 72ed6f9c9dc95124cd81158d1c4437484a1b951e Author: Faraz Vahedi AuthorDate: 2026-09-05 10:41:22 +0000 Commit: Faraz Vahedi CommitDate: 2026-09-05 10:41:22 +0000 libc: Add WCHAR_WIDTH in as well Define __WCHAR_WIDTH in sys/_types.h and derive WCHAR_WIDTH from that, the same way as WCHAR_MIN and WCHAR_MAX, in both and as per C23 §7.31.1 and §7.22.3.4, respectively. Reviewed by: fuz Approved by: fuz (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D59385 --- include/wchar.h | 3 +++ sys/arm/include/_stdint.h | 1 - sys/arm64/include/_stdint.h | 1 - sys/powerpc/include/_stdint.h | 1 - sys/riscv/include/_stdint.h | 1 - sys/sys/_types.h | 2 ++ sys/sys/stdint.h | 3 +++ sys/x86/include/_stdint.h | 1 - 8 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/wchar.h b/include/wchar.h index 1447d083a889..d191981be5ff 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -97,6 +97,9 @@ typedef __wint_t wint_t; #define WCHAR_MIN __WCHAR_MIN #define WCHAR_MAX __WCHAR_MAX +#if __ISO_C_VISIBLE >= 2023 +#define WCHAR_WIDTH __WCHAR_WIDTH +#endif #ifndef WEOF #define WEOF ((wint_t)-1) diff --git a/sys/arm/include/_stdint.h b/sys/arm/include/_stdint.h index 9f9b7eb8a554..b0b92f8de72f 100644 --- a/sys/arm/include/_stdint.h +++ b/sys/arm/include/_stdint.h @@ -166,7 +166,6 @@ #define PTRDIFF_WIDTH INT32_WIDTH #define SIG_ATOMIC_WIDTH INT32_WIDTH #define SIZE_WIDTH INT32_WIDTH -#define WCHAR_WIDTH INT32_WIDTH #define WINT_WIDTH INT32_WIDTH #endif /* __ISO_C_VISIBLE >= 2023 */ diff --git a/sys/arm64/include/_stdint.h b/sys/arm64/include/_stdint.h index 621e5ce53721..1088ab383a35 100644 --- a/sys/arm64/include/_stdint.h +++ b/sys/arm64/include/_stdint.h @@ -168,7 +168,6 @@ #define PTRDIFF_WIDTH INT64_WIDTH #define SIG_ATOMIC_WIDTH INT64_WIDTH #define SIZE_WIDTH INT64_WIDTH -#define WCHAR_WIDTH INT32_WIDTH #define WINT_WIDTH INT32_WIDTH #endif /* __ISO_C_VISIBLE >= 2023 */ diff --git a/sys/powerpc/include/_stdint.h b/sys/powerpc/include/_stdint.h index 68ae89e23cdc..5423badb25a6 100644 --- a/sys/powerpc/include/_stdint.h +++ b/sys/powerpc/include/_stdint.h @@ -213,7 +213,6 @@ #define SIZE_WIDTH INT32_WIDTH #endif #define SIG_ATOMIC_WIDTH INT32_WIDTH -#define WCHAR_WIDTH INT32_WIDTH #define WINT_WIDTH INT32_WIDTH #endif /* __ISO_C_VISIBLE >= 2023 */ diff --git a/sys/riscv/include/_stdint.h b/sys/riscv/include/_stdint.h index 9afe01c8a318..3cfb78208aec 100644 --- a/sys/riscv/include/_stdint.h +++ b/sys/riscv/include/_stdint.h @@ -164,7 +164,6 @@ #define PTRDIFF_WIDTH INT64_WIDTH #define SIG_ATOMIC_WIDTH INT64_WIDTH #define SIZE_WIDTH INT64_WIDTH -#define WCHAR_WIDTH INT32_WIDTH #define WINT_WIDTH INT32_WIDTH #endif /* __ISO_C_VISIBLE >= 2023 */ diff --git a/sys/sys/_types.h b/sys/sys/_types.h index bc438c17c8c0..a2f89b1f2055 100644 --- a/sys/sys/_types.h +++ b/sys/sys/_types.h @@ -129,6 +129,8 @@ typedef __size_t __vm_size_t; */ #include +#define __WCHAR_WIDTH 32 /* number of bits in a wchar_t */ + /* * Standard type definitions. */ diff --git a/sys/sys/stdint.h b/sys/sys/stdint.h index dccc5a8e6a6d..661945c18281 100644 --- a/sys/sys/stdint.h +++ b/sys/sys/stdint.h @@ -68,6 +68,9 @@ typedef __uint_fast64_t uint_fast64_t; /* Limits of wchar_t. */ #define WCHAR_MIN __WCHAR_MIN #define WCHAR_MAX __WCHAR_MAX +#if __ISO_C_VISIBLE >= 2023 +#define WCHAR_WIDTH __WCHAR_WIDTH +#endif #if __EXT1_VISIBLE /* ISO/IEC 9899:2011 K.3.4.4 */ diff --git a/sys/x86/include/_stdint.h b/sys/x86/include/_stdint.h index 4c65b0f095ea..fa51cd27b8a8 100644 --- a/sys/x86/include/_stdint.h +++ b/sys/x86/include/_stdint.h @@ -207,7 +207,6 @@ #define SIG_ATOMIC_WIDTH INT32_WIDTH #define SIZE_WIDTH INT32_WIDTH #endif -#define WCHAR_WIDTH INT32_WIDTH #define WINT_WIDTH INT32_WIDTH #endif /* __ISO_C_VISIBLE >= 2023 */