diff options
author | 2015-01-23 09:50:45 +0000 | |
---|---|---|
committer | 2015-01-23 09:50:45 +0000 | |
commit | 4f190dc567f0c6ab6c86a96164aac91627ddb7d4 (patch) | |
tree | 55852d6bdbd98287dae38a3017a8f116857b39c3 | |
parent | zap trailing whitespace; (diff) | |
download | wireguard-openbsd-4f190dc567f0c6ab6c86a96164aac91627ddb7d4.tar.xz wireguard-openbsd-4f190dc567f0c6ab6c86a96164aac91627ddb7d4.zip |
get the args right for the fallback atomic_{cas,swap}_ptr
implementations, and then cast the pointer to the right type for
the gcc builtins.
-rw-r--r-- | sys/sys/atomic.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/sys/atomic.h b/sys/sys/atomic.h index 6c520498d3f..23b3030f8c1 100644 --- a/sys/sys/atomic.h +++ b/sys/sys/atomic.h @@ -1,4 +1,4 @@ -/* $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> * @@ -47,9 +47,9 @@ atomic_cas_ulong(unsigned long *p, unsigned long o, unsigned long n) #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 @@ -75,9 +75,9 @@ atomic_swap_ulong(unsigned long *p, unsigned long v) #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 |