From 18dba078cb6e67478a5e8741a15ca708c54bdde1 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sat, 15 Dec 2012 15:12:36 +0100 Subject: [PATCH] Fix compilation on FreeBSD 10.0-CURRENT with clang as cc Previously it failed with: In file included from t.c:27: ./CAS.h:56:3: error: void function 'atomic_add' should not return a value [-Wreturn-type] return __sync_add_and_fetch(x,val); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- CAS.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAS.h b/CAS.h index 27b3219..1308050 100644 --- a/CAS.h +++ b/CAS.h @@ -53,7 +53,7 @@ static inline size_t atomic_add_return(size_t* x,size_t val) { /* *x += val; */ static inline void atomic_add(size_t* x,size_t val) { #ifdef USE_BUILTINS - return __sync_add_and_fetch(x,val); + __sync_add_and_fetch(x,val); #elif defined(__i386__) asm volatile ("lock; addl %1, %0" : "+m" (*x) : "ir" (val) ); #elif defined(__x86_64__) -- 1.8.0.2