/* Determine the wordsize from the preprocessor defines. wasm32 version. Copyright (C) 2026 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #define __WORDSIZE 32 #define __WORDSIZE_TIME64_COMPAT32 0 /* clang's wasm32 target types the pointer/offset integer family as long: __INTPTR_TYPE__/__UINTPTR_TYPE__ are long/unsigned long and __PTRDIFF_TYPE__/__SIZE_TYPE__ are long/unsigned long. Elect the long forms below so the libc typedefs and limit macros keep the same C/C++ type identity as the compiler's builtins (int and long are both 32-bit here; only type identity is at stake, not layout). __WORDSIZE32_SIZE_ULONG = 1 (brintos/glibc#2, completing the #1 type- identity work): SIZE_MAX/SSIZE_MAX carry the long forms so SIZE_MAX is type-identical to size_t (= clang's __SIZE_TYPE__ = unsigned long) and SSIZE_MAX to ssize_t. The half fix was deliberately withheld under #1: flipping this knob alone retypes SSIZE_MAX to long while ssize_t is still __SWORD_TYPE == int. The other half lands with it — the port bits/typesizes.h (sysdeps/unix/sysv/linux/wasm32/bits/typesizes.h) makes __SSIZE_T_TYPE == __SLONGWORD_TYPE, the s390 -m31 precedent (sysdeps/unix/sysv/linux/s390/bits/typesizes.h: "size_t is unsigned long int on s390 -m31"). */ #define __WORDSIZE32_SIZE_ULONG 1 #define __WORDSIZE32_PTRDIFF_LONG 1 #define __WORDSIZE32_INTPTR_LONG 1