diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2002-02-13 01:22:18 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2002-02-13 01:22:18 +0000 |
commit | 80bb04ceafd65efcf3a98891b41a194fbe418c60 (patch) | |
tree | c9f9e311195cfce0beafab7adb55b49043940e02 | |
parent | be6930118947bea8813d3b047e4a66388216d7fd (diff) | |
download | libapr-80bb04ceafd65efcf3a98891b41a194fbe418c60.tar.gz |
get APR to build with --disable-threads... there is no
implementation of apr atomic stuff for Unix unless
APR_HAS_THREADS
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62971 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | atomic/unix/apr_atomic.c | 5 | ||||
-rw-r--r-- | include/apr_atomic.h | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index d85d60ddf..cedcb9fd5 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -7,6 +7,8 @@ /* win32 implementation is all macros */ #else +#if APR_HAS_THREADS + #define NUM_ATOMIC_HASH 7 /* shift by 2 to get rid of alignment issues */ #define ATOMIC_HASH(x) (int)(((long)x>>2)%NUM_ATOMIC_HASH) @@ -92,4 +94,7 @@ long apr_atomic_cas(volatile long *mem,long with,long cmp) } return *mem; } + +#endif /* APR_HAS_THREADS */ + #endif /* default implementation */ diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 35f88355a..2d32e62ce 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -73,6 +73,9 @@ extern "C" { #define apr_atomic_init(pool) APR_SUCCESS #else + +#if APR_HAS_THREADS + #define apr_atomic_read(p) *p apr_status_t apr_atomic_init(apr_pool_t *p); long apr_atomic_set(volatile long*mem, long val); @@ -81,6 +84,8 @@ long apr_atomic_inc( volatile long *mem); long apr_atomic_dec(volatile long *mem); long apr_atomic_cas(volatile long *mem,long with,long cmp); +#endif /* APR_HAS_THREADS */ + #endif #ifdef __cplusplus } |