--- common/threading.h 2026-04-19 14:29:17.000000000 +0800 +++ common/threading.h 2026-05-29 18:31:47.000000000 +0800 @@ -81,11 +81,11 @@ #define BSF(id, x) (id) = ((unsigned long)__builtin_ctz(x)) #define BSR64(id, x) (id) = ((unsigned long)__builtin_clzll(x) ^ 63) #define BSF64(id, x) (id) = ((unsigned long)__builtin_ctzll(x)) -#define ATOMIC_OR(ptr, mask) __sync_fetch_and_or(ptr, mask) -#define ATOMIC_AND(ptr, mask) __sync_fetch_and_and(ptr, mask) -#define ATOMIC_INC(ptr) __sync_add_and_fetch((volatile int32_t*)ptr, 1) -#define ATOMIC_DEC(ptr) __sync_add_and_fetch((volatile int32_t*)ptr, -1) -#define ATOMIC_ADD(ptr, val) __sync_fetch_and_add((volatile __typeof__(*(ptr))*)ptr, (__typeof__(*(ptr) + 0))(val)) +#define ATOMIC_OR(ptr, mask) __atomic_fetch_or((ptr), (mask), __ATOMIC_SEQ_CST) +#define ATOMIC_AND(ptr, mask) __atomic_fetch_and((ptr), (mask), __ATOMIC_SEQ_CST) +#define ATOMIC_INC(ptr) __atomic_add_fetch((volatile int32_t*)(ptr), 1, __ATOMIC_SEQ_CST) +#define ATOMIC_DEC(ptr) __atomic_add_fetch((volatile int32_t*)(ptr), -1, __ATOMIC_SEQ_CST) +#define ATOMIC_ADD(ptr, val) __atomic_fetch_add((volatile __typeof__(*(ptr))*)(ptr), (__typeof__(*(ptr) + 0))(val), __ATOMIC_SEQ_CST) #define GIVE_UP_TIME() usleep(0) #elif defined(_MSC_VER) /* Windows atomic intrinsics */ --- CMakeLists.txt 2026-04-19 14:29:17.000000000 +0800 +++ CMakeLists.txt 2026-05-29 18:08:51.000000000 +0800 @@ -285,7 +285,7 @@ endif() add_definitions(-std=gnu++11) else() - add_definitions(-std=gnu++98) + add_definitions(-std=gnu++11) endif() if(ENABLE_PIC) add_definitions(-fPIC)