aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Coopersmith2015-02-07 11:12:25 -0600
committerAlan Coopersmith2015-02-12 16:18:31 -0600
commitdd89e1efd05299ec4015d144158d2eceeb6a6484 (patch)
treefbf38b78769742156f7aab45058e7ef1a59cb9b1 /xf86atomic.h
parent95f23cf894757d05a6b6c980062a46968dc069b1 (diff)
downloadexternal-libdrm-dd89e1efd05299ec4015d144158d2eceeb6a6484.tar.gz
external-libdrm-dd89e1efd05299ec4015d144158d2eceeb6a6484.tar.xz
external-libdrm-dd89e1efd05299ec4015d144158d2eceeb6a6484.zip
Stop undefining _ATOMIC_TYPE in Solaris/NetBSD section of xf86atomic.h
Since the atomic_set() macro references _ATOMIC_TYPE, undefining it broke that macro, resulting in build errors of: "intel_bufmgr_gem.c", line 775: undefined symbol: _ATOMIC_TYPE Now that we're leaving the macro in the namespace, renamed it to start with LIBDRM_ instead of _ to avoid polluting others namespace. Regression introduced in 87fdd32c8779648 Add NetBSD atomic ops support. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-By: Thomas Klausner <wiz@NetBSD.org>
Diffstat (limited to 'xf86atomic.h')
-rw-r--r--xf86atomic.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/xf86atomic.h b/xf86atomic.h
index e794af8e..8c4b696a 100644
--- a/xf86atomic.h
+++ b/xf86atomic.h
@@ -81,22 +81,21 @@ typedef struct {
81#define HAS_ATOMIC_OPS 1 81#define HAS_ATOMIC_OPS 1
82 82
83#if defined(__NetBSD__) 83#if defined(__NetBSD__)
84#define _ATOMIC_TYPE int 84#define LIBDRM_ATOMIC_TYPE int
85#else 85#else
86#define _ATOMIC_TYPE uint_t 86#define LIBDRM_ATOMIC_TYPE uint_t
87#endif 87#endif
88 88
89typedef struct { _ATOMIC_TYPE atomic; } atomic_t; 89typedef struct { LIBDRM_ATOMIC_TYPE atomic; } atomic_t;
90 90
91# define atomic_read(x) (int) ((x)->atomic) 91# define atomic_read(x) (int) ((x)->atomic)
92# define atomic_set(x, val) ((x)->atomic = (_ATOMIC_TYPE)(val)) 92# define atomic_set(x, val) ((x)->atomic = (LIBDRM_ATOMIC_TYPE)(val))
93# define atomic_inc(x) (atomic_inc_uint (&(x)->atomic)) 93# define atomic_inc(x) (atomic_inc_uint (&(x)->atomic))
94# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 0) 94# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 0)
95# define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v))) 95# define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v)))
96# define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v))) 96# define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v)))
97# define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, newv) 97# define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, newv)
98 98
99#undef _ATOMIC_TYPE
100#endif 99#endif
101 100
102#if ! HAS_ATOMIC_OPS 101#if ! HAS_ATOMIC_OPS