apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Rodrigues <rodr...@attbi.com>
Subject Problem with apr_atomic on FreeBSD
Date Sun, 23 Mar 2003 00:37:05 GMT

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__)
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        

View raw message