diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2017-02-11 18:35:55 -0800 |
---|---|---|
committer | Juan A. Suarez Romero <jasuarez@igalia.com> | 2019-10-16 14:49:34 +0000 |
commit | 740b0e9dc7597070a345cbcea57421f6894041fb (patch) | |
tree | 9bd13407e0cde900e20857480fb6f762dab9b658 | |
parent | 9eaa6998cc4326e3895159ddae7b20cc5bcf4ed8 (diff) | |
download | mesa-740b0e9dc7597070a345cbcea57421f6894041fb.tar.gz |
util: Make Solaris implemention of p_atomic_add work with gcc
gcc is very particular about where you place the (void) cast
The previous placement made it error out with:
In file included from disk_cache.c:40:0:
../../src/util/u_atomic.h:203:29: error: void value not ignored as it ought to be
#define p_atomic_add(v, i) ((void) \
^
disk_cache.c:658:4: note: in expansion of macro ‘p_atomic_add’
p_atomic_add(cache->size, size);
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit a56c3e3a470eb8f13d11ca0aad5b5934de54ca1c)
-rw-r--r-- | src/util/u_atomic.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/u_atomic.h b/src/util/u_atomic.h index c6d4bde3439..5949d85af1e 100644 --- a/src/util/u_atomic.h +++ b/src/util/u_atomic.h @@ -189,7 +189,7 @@ sizeof(*v) == sizeof(uint64_t) ? atomic_inc_64_nv((uint64_t *)(v)) : \ (assert(!"should not get here"), 0)) -#define p_atomic_dec(v) ((void) \ +#define p_atomic_dec(v) (void) ( \ sizeof(*v) == sizeof(uint8_t) ? atomic_dec_8 ((uint8_t *)(v)) : \ sizeof(*v) == sizeof(uint16_t) ? atomic_dec_16((uint16_t *)(v)) : \ sizeof(*v) == sizeof(uint32_t) ? atomic_dec_32((uint32_t *)(v)) : \ @@ -203,7 +203,7 @@ sizeof(*v) == sizeof(uint64_t) ? atomic_dec_64_nv((uint64_t *)(v)) : \ (assert(!"should not get here"), 0)) -#define p_atomic_add(v, i) ((void) \ +#define p_atomic_add(v, i) (void) ( \ sizeof(*v) == sizeof(uint8_t) ? atomic_add_8 ((uint8_t *)(v), (i)) : \ sizeof(*v) == sizeof(uint16_t) ? atomic_add_16((uint16_t *)(v), (i)) : \ sizeof(*v) == sizeof(uint32_t) ? atomic_add_32((uint32_t *)(v), (i)) : \ |