diff options
author | bnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68> | 2003-01-10 23:29:18 +0000 |
---|---|---|
committer | bnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68> | 2003-01-10 23:29:18 +0000 |
commit | f7b103f9f1923aea57a1773b7106cd21eea05b02 (patch) | |
tree | 93c2243c17c22013080acab776a016094f6e0354 | |
parent | 92a2127c7681a958f2c9aa78cf9778280d97d549 (diff) | |
download | libapr-f7b103f9f1923aea57a1773b7106cd21eea05b02.tar.gz |
Replaced the apr_atomic_dec function and the apr_atomic_casptr macro
with inline functions for NetWare.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64288 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | NWGNUmakefile | 5 | ||||
-rw-r--r-- | include/apr_atomic.h | 20 |
2 files changed, 16 insertions, 9 deletions
diff --git a/NWGNUmakefile b/NWGNUmakefile index 28032e28b..b57e51dbb 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -236,7 +236,6 @@ FILES_nlm_exports = \ # Paths must all use the '/' character # FILES_lib_objs = \ - $(OBJDIR)/apr_atomic.o \ $(OBJDIR)/apr_cpystrn.o \ $(OBJDIR)/apr_fnmatch.o \ $(OBJDIR)/apr_getpass.o \ @@ -316,10 +315,6 @@ install :: nlms FORCE # Any specialized rules here # -$(OBJDIR)/%.o: atomic/netware/%.c $(OBJDIR)\cc.opt - @echo Compiling $< - $(CC) atomic\netware\$(<F) -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt - $(OBJDIR)/%.o: strings/%.c $(OBJDIR)\cc.opt @echo Compiling $< $(CC) strings\$(<F) -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt diff --git a/include/apr_atomic.h b/include/apr_atomic.h index b6737de98..c58b1fc6e 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -173,15 +173,27 @@ typedef LONG apr_atomic_t; #define apr_atomic_t unsigned long #define apr_atomic_add(mem, val) atomic_add(mem,val) -APR_DECLARE(int) apr_atomic_dec(apr_atomic_t *mem); -#define APR_OVERRIDE_ATOMIC_DEC 1 -#define APR_OVERRIDE_ATOMIC_CASPTR 1 #define apr_atomic_inc(mem) atomic_inc(mem) #define apr_atomic_set(mem, val) (*mem = val) #define apr_atomic_read(mem) (*mem) #define apr_atomic_init(pool) APR_SUCCESS #define apr_atomic_cas(mem,with,cmp) atomic_cmpxchg((unsigned long *)(mem),(unsigned long)(cmp),(unsigned long)(with)) -#define apr_atomic_casptr(mem,with,cmp) (void*)atomic_cmpxchg((unsigned long *)(mem),(unsigned long)(cmp),(unsigned long)(with)) + +int apr_atomic_dec(apr_atomic_t *mem); +void *apr_atomic_casptr(void **mem, void *with, const void *cmp); +#define APR_OVERRIDE_ATOMIC_DEC 1 +#define APR_OVERRIDE_ATOMIC_CASPTR 1 + +inline int apr_atomic_dec(apr_atomic_t *mem) +{ + atomic_dec(mem); + return *mem; +} + +inline void *apr_atomic_casptr(void **mem, void *with, const void *cmp) +{ + return (void*)atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); +} #elif defined(__FreeBSD__) |