diff --git a/include/socks/compiler.h b/include/socks/compiler.h index bcdba79..305afb2 100644 --- a/include/socks/compiler.h +++ b/include/socks/compiler.h @@ -1,6 +1,9 @@ #ifndef SOCKS_COMPILER_H_ #define SOCKS_COMPILER_H_ +#define READ_ONCE(p) (*((const volatile typeof(p) *)&(p))) +#define WRITE_ONCE(p, v) *(volatile typeof(p) *)&(p) = (v) + #undef __used #define __used __attribute__((used))