-/* $OpenBSD: atomic.h,v 1.1 2014/01/30 00:44:20 dlg Exp $ */
+/* $OpenBSD: atomic.h,v 1.2 2015/01/23 09:50:45 dlg Exp $ */
/*
* Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
*
#ifndef atomic_cas_ptr
static inline void *
-atomic_cas_ptr(void **p, void *o, void *n)
+atomic_cas_ptr(void *p, void *o, void *n)
{
- return __sync_val_compare_and_swap(p, o, n);
+ return __sync_val_compare_and_swap((void **)p, o, n);
}
#endif
#ifndef atomic_swap_ptr
static inline void *
-atomic_swap_ptr(void **p, void *v)
+atomic_swap_ptr(void *p, void *v)
{
- return __sync_lock_test_and_set(p, v);
+ return __sync_lock_test_and_set((void **)p, v);
}
#endif