apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Reid <da...@kosh.jetnet.co.uk>
Subject [PATCH] FreeBSD atomics
Date Fri, 31 Oct 2003 12:22:31 GMT
This changes i386 freeBSD to use the linux implementation. This gets
round the fact that the actual FreeBSD functions return void, which
doesn't gel with our api.

Tested on FreeBSD 4.8 and it allows all the tests to pass.

david


Index: include/apr_atomic.h
===================================================================
RCS file: /home/cvs/apr/include/apr_atomic.h,v
retrieving revision 1.60
diff -u -r1.60 apr_atomic.h
--- include/apr_atomic.h	15 Oct 2003 21:33:22 -0000	1.60
+++ include/apr_atomic.h	31 Oct 2003 11:50:47 -0000
@@ -70,7 +70,7 @@
 /* Platform includes for atomics */
 #if defined(NETWARE) || defined(__MVS__) /* OS/390 */
 #include <stdlib.h>
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) && !defined(__i386__)
 #include <machine/atomic.h>
 #endif
 
@@ -325,7 +325,7 @@
 #define APR_OVERRIDE_ATOMIC_DEC     1
 #define APR_OVERRIDE_ATOMIC_CAS     1
 
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) && !defined(__i386__)
 
 #define apr_atomic_t apr_uint32_t
 #define apr_atomic_add(mem, val)     atomic_add_int(mem,val)
@@ -337,10 +337,11 @@
 #define apr_atomic_add32(mem, val)        apr_atomic_add(mem, val)
 #define apr_atomic_dec32(mem)             apr_atomic_dec(mem)
 #define apr_atomic_inc32(mem)             apr_atomic_inc(mem)
-#define apr_atomic_set32(mem)             apr_atomic_set(mem)
+#define apr_atomic_set32(mem, val)        apr_atomic_set(mem, val)
 #define apr_atomic_read32(mem)            apr_atomic_read(mem)
 
-#elif (defined(__linux__) || defined(__EMX__)) && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC
+#elif (defined(__linux__) || defined(__EMX__) || defined(__FreeBSD__)) \
+        && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC
 
 #define apr_atomic_t apr_uint32_t
 #define apr_atomic_cas(mem,with,cmp) \


Mime
View raw message