From nobody Sat Sep 05 10:48:42 2026 X-Original-To: dev-commits-src-all@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 4hcVSH501wz6rLZK for ; Sat, 05 Sep 2026 10:48:47 +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 4hcVSH4NCLz3Hlm for ; Sat, 05 Sep 2026 10:48:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788605327; 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=jmpzXY8b96LvfZc9b+ePNfYblX9ruzw/Y1E2EH09KkfYyUbD/lNkLU8ZSHGgWT5bwYNn06 aAfWvb0BA19iClu4PNeaF3zYPEasye7rwnrkBMnIg/5+oOjsJR+OYOH5elZH//qbrL0uoU jVqZOq+l11mZb/RBvS8JIhWQHhhBqD2tX+KJnB8Ql/HRQCxM/s15S4KwRVW2C/Cw+95YYW TpSD8TeEY6Uz2P7+ysknvpJl/ShUZU3GpRgZGUscVoAtLDPILObsh3ggk/qvLPydeNEVmB 4xerqlKrzAFxwqbSJqUlyxD75pacl80IgXDAHkKVJIzvFiYN2TjJiNXzWYo2EA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788605327; a=rsa-sha256; cv=none; b=cgyTlp+U572s0mcJQdqHIlInU0vVjnPFNOiORaRMZbBUV2xr1DjIGJVPqN3ufyRtYol4lp /SPHfnZLGylQ7UGgPyiB6a42VFtOfcGwpqF8SFHLITNqW1+tbMAJP72MdKCfp2do+kcfDH Bx2GSSUs5T1K5xwpeCeUrs6rME2UgqSuNIC0StZekBU4tFo9i9ga5r1Rv/0JLzIefN+HW5 VLu2TjjaMLlTu2B2ExovbMEPNEi7VBg5vAe3cwcS8LxQ+JLa/nnA3EjDCFTSmxDg7Iy9TH jM339tuOHSxxje3Knlrg+vwxm9Jv7xcrrVlqo0pVnLcFw/JQwTE5jE07AVee+g== 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=1788605327; 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=AGqDXI+Fp/dLTuQKxQmO2zlP7COoUoHAvjKGIBOl8TF4cJTd1dmbvo5ruiRkR3x3aotWHG VqdkKJRaTIF4yt1/ichc4bWiYYYriaOdcH7x1uo0lo1czwpf+8yYn40U/RufQdj/35iD3k X4DUKImnFVfnU3KplYVFcf9qW+P4LVr/rR5cJi1TbZAKNVi/cKo+iMK8tKACvJsqczEVIg D0d++2EA/hyHMzZT6XlOaM/MKVAihzDz5xY4SKj4RDxag8vE84LI/q63zahf+IPuBog6kO cW0rKmN1IHa6rwf2V8POL8yH+Dpg2u+kejptdgnCJlnwz1R3f4CUgnDdxkRsIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hcVSH2ztkzk4d for ; Sat, 05 Sep 2026 10:48:47 +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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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 */