From e03f26b0356090c657870f6446f7f8848c99b6ad Mon Sep 17 00:00:00 2001 From: daanx Date: Mon, 17 Apr 2023 11:39:55 -0700 Subject: [PATCH] fix atomic signature --- include/mimalloc/atomic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mimalloc/atomic.h b/include/mimalloc/atomic.h index 857e9f02..61577833 100644 --- a/include/mimalloc/atomic.h +++ b/include/mimalloc/atomic.h @@ -290,8 +290,8 @@ typedef _Atomic(uintptr_t) mi_atomic_guard_t; #define mi_atomic_guard(guard) \ uintptr_t _mi_guard_expected = 0; \ for(bool _mi_guard_once = true; \ - _mi_guard_once && mi_atomic_cas_strong_acq_rel(guard,&_mi_guard_expected,1); \ - (mi_atomic_store_release(guard,0), _mi_guard_once = false) ) + _mi_guard_once && mi_atomic_cas_strong_acq_rel(guard,&_mi_guard_expected,(uintptr_t)1); \ + (mi_atomic_store_release(guard,(uintptr_t)0), _mi_guard_once = false) )