diff options
author | John Baldwin <jhb@FreeBSD.org> | 2022-08-12 10:52:20 -0700 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2022-10-27 17:35:58 -0700 |
commit | cd3fd31d67f0a5182916723098ddbf9bcd848e9c (patch) | |
tree | dd4d0e38f2cba23b47c494431e81ca05b2ba26da | |
parent | Fix builds for kernels without INET and/or INET6. (diff) | |
download | wireguard-freebsd-cd3fd31d67f0a5182916723098ddbf9bcd848e9c.tar.xz wireguard-freebsd-cd3fd31d67f0a5182916723098ddbf9bcd848e9c.zip |
compat: Add shims for atomic_load/store_bool.
These were added upstream in FreeBSD in commit
2bed73739aac352299222a18f669a03544c7c9e2.
Signed-off-by: John Baldwin <jhb@FreeBSD.org>
-rw-r--r-- | src/compat.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compat.h b/src/compat.h index d55c628..8349737 100644 --- a/src/compat.h +++ b/src/compat.h @@ -7,6 +7,12 @@ */ #include <sys/param.h> +#include <machine/atomic.h> + +#ifndef atomic_load_bool +#define atomic_load_bool(p) (*(volatile _Bool *)(p)) +#define atomic_store_bool(p, v) (*(volatile _Bool *)(p) = (_Bool)(v)) +#endif #if (__FreeBSD_version < 1400036 && __FreeBSD_version >= 1400000) || __FreeBSD_version < 1300519 #define COMPAT_NEED_CHACHA20POLY1305_MBUF |