Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 1086 invoked by uid 500); 23 Mar 2003 00:36:52 -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 Received: (qmail 1074 invoked from network); 23 Mar 2003 00:36:52 -0000 Date: Sat, 22 Mar 2003 19:37:05 -0500 From: Craig Rodrigues To: dev@apr.apache.org Subject: Problem with apr_atomic on FreeBSD Message-ID: <20030323003705.GA90432@attbi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, I solved my previous problem with apr 0.9.2 and FreeBSD-CURRENT by updating my FreeBSD-CURRENT. I now have: FreeBSD 5.0-CURRENT #17: Sat Mar 22 12:29:32 EST 2003 Now I have a new problem. If I try to compile in the test directory, I get: testatomic.c:84: void value not ignored as it ought to be testatomic.c:89: void value not ignored as it ought to be gmake[1]: *** [testatomic.lo] Error 1 The lines are: 84 if (apr_atomic_dec(&y) == 0) { 85 fprintf(stderr, "Failed\noldval =%d should not be zero\n", 86 apr_atomic_read(&y)); 87 return APR_EGENERAL; 88 } 89 if (apr_atomic_dec(&y) != 0) { The problem is caused by this block in apr_atomic.h: 205 #elif defined(__FreeBSD__) 206 207 #define apr_atomic_t apr_uint32_t 208 #define apr_atomic_add(mem, val) atomic_add_int(mem,val) 209 #define apr_atomic_dec(mem) atomic_subtract_int(mem,1) 210 #define apr_atomic_inc(mem) atomic_add_int(mem,1) 211 #define apr_atomic_set(mem, val) atomic_set_int(mem, val) 212 #define apr_atomic_read(mem) (*mem) The problem is that atomic_subtract_int() returns a void, not an int. The interface for apr_atomic_dec() seems to require returning an int. How can this be solved? -- Craig Rodrigues http://home.attbi.com/~rodrigc rodrigc@attbi.com