Alfred Agrell (@Alcaro) commented about dlls/winewayland.drv/waylanddrv.h:
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +#if defined(__STDC_NO_ATOMICS__) +# error C11 Atomic Operations not support. +#else +#include <stdatomic.h> +#include <stdint.h> +#include <unistd.h> +#include <linux/futex.h> +#include <sys/syscall.h> +#define WINEWAYLAND_USE_ATOMIC +#define WINEWAYLAND_RESOURCE_TYPE _Atomic unsigned char +#define WINEWAYLAND_RESOURCE_INIT ATOMIC_VAR_INIT(0) +#define WINEWAYLAND_RESOURCE_LOCK(RESOURCE) { \
- unsigned char expected = 0; \
- while(!atomic_compare_exchange_weak(RESOURCE, &expected, 1)) { \
syscall(SYS_futex, RESOURCE, FUTEX_WAIT, 1, NULL, NULL, 0); \
The futex syscall takes a pointer to int, not unsigned char.