summaryrefslogtreecommitdiff
path: root/include/sys
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2024-05-07 09:11:10 -0400
committerRich Felker <dalias@aerifal.cx>2024-05-07 09:11:10 -0400
commit7019fbe103165b9b26a9391d5ecd4c7fcb6f3ec9 (patch)
tree2608a8d167e1453b8145b527ad66f90a6d0a5c2c /include/sys
parente709a6f07ade208ba513f9225222336f30c304b0 (diff)
downloadmusl-7019fbe103165b9b26a9391d5ecd4c7fcb6f3ec9.tar.gz
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.
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/user.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/sys/user.h b/include/sys/user.h
index 96a03400..78036da3 100644
--- a/include/sys/user.h
+++ b/include/sys/user.h
@@ -8,6 +8,15 @@ extern "C" {
#include <stdint.h>
#include <unistd.h>
+#include <bits/alltype.h>
+
+#undef __WORDSIZE
+#if __LONG_MAX == 0x7fffffffL
+#define __WORDSIZE 32
+#else
+#define __WORDSIZE 64
+#endif
+
#include <bits/user.h>
#ifdef __cplusplus