diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-12-26 16:39:20 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-12-26 16:39:20 +0100 |
commit | 1557829c6c69f481d8d5b2cfb92cfab3d3f80dd4 (patch) | |
tree | 95a386bd03f184806d6d43e98fda86c91e6d52b7 /lib/conncache.h | |
parent | 6b4c9b8ae0f6283ed8282d56222dd42c119a14a3 (diff) | |
download | curl-bagder/aws-macro-warning.tar.gz |
fixup more empty expressions fixedbagder/aws-macro-warning
Diffstat (limited to 'lib/conncache.h')
-rw-r--r-- | lib/conncache.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/conncache.h b/lib/conncache.h index 7b7ba1205..c8ee0b8df 100644 --- a/lib/conncache.h +++ b/lib/conncache.h @@ -49,17 +49,24 @@ struct conncache { #ifdef CURLDEBUG /* the debug versions of these macros make extra certain that the lock is never doubly locked or unlocked */ -#define CONNCACHE_LOCK(x) if((x)->share) { \ - Curl_share_lock((x), CURL_LOCK_DATA_CONNECT, CURL_LOCK_ACCESS_SINGLE); \ - DEBUGASSERT(!(x)->state.conncache_lock); \ - (x)->state.conncache_lock = TRUE; \ - } +#define CONNCACHE_LOCK(x) \ + do { \ + if((x)->share) { \ + Curl_share_lock((x), CURL_LOCK_DATA_CONNECT, \ + CURL_LOCK_ACCESS_SINGLE); \ + DEBUGASSERT(!(x)->state.conncache_lock); \ + (x)->state.conncache_lock = TRUE; \ + } \ + } while(0) -#define CONNCACHE_UNLOCK(x) if((x)->share) { \ - DEBUGASSERT((x)->state.conncache_lock); \ - (x)->state.conncache_lock = FALSE; \ - Curl_share_unlock((x), CURL_LOCK_DATA_CONNECT); \ - } +#define CONNCACHE_UNLOCK(x) \ + do { \ + if((x)->share) { \ + DEBUGASSERT((x)->state.conncache_lock); \ + (x)->state.conncache_lock = FALSE; \ + Curl_share_unlock((x), CURL_LOCK_DATA_CONNECT); \ + } \ + } while(0) #else #define CONNCACHE_LOCK(x) if((x)->share) \ Curl_share_lock((x), CURL_LOCK_DATA_CONNECT, CURL_LOCK_ACCESS_SINGLE) |