Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 29447 invoked from network); 31 Oct 2003 12:40:12 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 31 Oct 2003 12:40:12 -0000 Received: (qmail 10388 invoked by uid 500); 31 Oct 2003 12:40:10 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 10163 invoked by uid 500); 31 Oct 2003 12:40:09 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Delivered-To: moderator for dev@apr.apache.org Received: (qmail 65768 invoked from network); 31 Oct 2003 12:09:18 -0000 Date: Fri, 31 Oct 2003 12:22:31 +0000 From: David Reid To: dev@apr.apache.org Subject: [PATCH] FreeBSD atomics Message-ID: <20031031122231.GA55646@kosh.jetnet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) && !defined(__i386__) #include #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) \