summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Devoogdt <thomas@devoogdt.com>2024-04-05 10:45:15 +0200
committerThomas Devoogdt <thomas@devoogdt.com>2024-04-05 10:45:15 +0200
commit4fca45a71f08a5bebd12d39c85f49e0b0e4426bf (patch)
treee58243db1d3749133f8b104bed7f64d6c393f3dd
parent042a1cf3705a2c70f6e22eb5bd8541dd32652c9b (diff)
src/xshmfence_futex.h: fix build on 32-bit architectures using 64-bit time_tHEADmaster
Fix the following build failure on 32-bit architectures using 64-bit time_t (e.g. riscv32): xshmfence_futex.h: In function 'sys_futex': xshmfence_futex.h:58:24: error: 'SYS_futex' undeclared (first use in this function); did you mean 'sys_futex'? 58 | return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3); | ^~~~~~~~~ | sys_futex Similar to: https://gitlab.freedesktop.org/mesa/mesa/-/commit/7d87478124061915582412ba410759afe863d679 Fixes: https://gitlab.com/buildroot.org/buildroot/-/commit/e39ad96136a8c340b3aea6b036024e28f14584f3 Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com> Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxshmfence/-/merge_requests/8>
-rw-r--r--src/xshmfence_futex.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xshmfence_futex.h b/src/xshmfence_futex.h
index 673ac0e..4476038 100644
--- a/src/xshmfence_futex.h
+++ b/src/xshmfence_futex.h
@@ -53,6 +53,10 @@ static inline int futex_wait(int32_t *addr, int32_t value) {
#include <sys/time.h>
#include <sys/syscall.h>
+#ifndef SYS_futex
+#define SYS_futex SYS_futex_time64
+#endif
+
static inline long sys_futex(void *addr1, int op, int val1, struct timespec *timeout, void *addr2, int val3)
{
return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);