diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2003-11-16 20:09:45 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2003-11-16 20:09:45 +0000 |
commit | b312e057380cd0986c7f412db5e609d5519282b2 (patch) | |
tree | db7aa6b9079b15accc697a6b0d6e735e2893d757 /include | |
parent | 2b0e2308c7d2ddfd89824f62fca68865f5e787c4 (diff) | |
download | libapr-b312e057380cd0986c7f412db5e609d5519282b2.tar.gz |
Correct misdeclaration of Win32 type remapping function typedefs.
Be pedantic in protecting some macro arguments, fix odd typos,
and use InterlockedExchangeAdd(*foo, -bar) for subtraction.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64750 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r-- | include/apr_atomic.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 21ceb9f81..14f39c996 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -193,28 +193,28 @@ void *apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); * Remapping function pointer type to accept apr_uint32_t's type-safely * as the arguments for as our apr_atomic_foo32 Functions */ -typedef WINBASEAPI apr_uint32_t (WINAPI apr_atomic_win32_ptr_fn) +typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_fn) (apr_uint32_t volatile *); -typedef WINBASEAPI apr_uint32_t (WINAPI apr_atomic_win32_ptr_val_fn) +typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_fn) (apr_uint32_t volatile *, apr_uint32_t); -typedef WINBASEAPI apr_uint32_t (WINAPI apr_atomic_win32_ptr_val_val_fn) +typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn) (apr_uint32_t volatile *, apr_uint32_t, apr_uint32_t); #define apr_atomic_add32(mem, val) \ ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem,val) #define apr_atomic_sub32(mem, val) \ - ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeSub)(mem,val) + ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem,-(val)) #define apr_atomic_inc32(mem) \ ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem) #define apr_atomic_dec32(mem) \ ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem) #define apr_atomic_set32(mem, val) \ ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem,val) -#define apr_atomic_read32(mem) (*mem) +#define apr_atomic_read32(mem) (*(mem)) #define apr_atomic_cas32(mem,with,cmp) \ - ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem,val) + ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem,with,cmp) #define apr_atomic_xchg32(mem,val) \ ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem,val) |