summaryrefslogtreecommitdiff
path: root/atomic
diff options
context:
space:
mode:
authorAllan K. Edwards <ake@apache.org>2004-09-20 19:20:12 +0000
committerAllan K. Edwards <ake@apache.org>2004-09-20 19:20:12 +0000
commit23fc35b7fb01e76c3606c842d80293c5e44f6acb (patch)
treefb159b42ecf45a664b8838c7a05366543efde011 /atomic
parent7ef50cea8e9c60a2753d8167ab9ac3c6f9dab0f9 (diff)
downloadapr-23fc35b7fb01e76c3606c842d80293c5e44f6acb.tar.gz
WIN64: avoid unresolved external error with 64 bit build
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65336 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'atomic')
-rw-r--r--atomic/win32/apr_atomic.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c
index d83d60c89..b42a2028e 100644
--- a/atomic/win32/apr_atomic.c
+++ b/atomic/win32/apr_atomic.c
@@ -40,7 +40,11 @@ typedef WINBASEAPI void * (WINAPI * apr_atomic_win32_ptr_ptr_ptr_fn)
APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val)
{
+#if (defined(_M_IA64) || defined(_M_AMD64))
+ return InterlockedExchangeAdd(mem, val);
+#else
return ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val);
+#endif
}
/* Of course we want the 2's compliment of the unsigned value, val */
@@ -48,7 +52,11 @@ APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint3
APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val)
{
+#if (defined(_M_IA64) || defined(_M_AMD64))
+ InterlockedExchangeAdd(mem, -val);
+#else
((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val);
+#endif
}
APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem)