From 7019fbe103165b9b26a9391d5ecd4c7fcb6f3ec9 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 7 May 2024 09:11:10 -0400 Subject: sys/user.h: derive __WORDSIZE from __LONG_MAX previously, only a few archs defined it here. this change makes the presence consistent across all archs, and reduces the amount of header duplication (and potential for future inconsistency) between archs. --- include/sys/user.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/sys/user.h b/include/sys/user.h index 96a0340..78036da 100644 --- a/include/sys/user.h +++ b/include/sys/user.h @@ -8,6 +8,15 @@ extern "C" { #include #include +#include + +#undef __WORDSIZE +#if __LONG_MAX == 0x7fffffffL +#define __WORDSIZE 32 +#else +#define __WORDSIZE 64 +#endif + #include #ifdef __cplusplus -- cgit v1.1