diff mbox

[PATCH:libdrm] Stop undefining _ATOMIC_TYPE in Solaris/NetBSD section of xf86atomic.h

Message ID 1423329666-12059-1-git-send-email-alan.coopersmith@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alan Coopersmith Feb. 7, 2015, 5:21 p.m. UTC
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>
---
 xf86atomic.h |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Thomas Klausner Feb. 8, 2015, 9:32 a.m. UTC | #1
Reviewed-By: Thomas Klausner <wiz@NetBSD.org>

Sorry for the breakage.
 Thomas

On Sat, Feb 07, 2015 at 09:21:06AM -0800, Alan Coopersmith wrote:
> 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>
> ---
>  xf86atomic.h |    9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/xf86atomic.h b/xf86atomic.h
> index e794af8..8c4b696 100644
> --- a/xf86atomic.h
> +++ b/xf86atomic.h
> @@ -81,22 +81,21 @@ typedef struct {
>  #define HAS_ATOMIC_OPS 1
>  
>  #if defined(__NetBSD__)
> -#define _ATOMIC_TYPE int
> +#define LIBDRM_ATOMIC_TYPE int
>  #else
> -#define _ATOMIC_TYPE uint_t
> +#define LIBDRM_ATOMIC_TYPE uint_t
>  #endif
>  
> -typedef struct { _ATOMIC_TYPE atomic; } atomic_t;
> +typedef struct { LIBDRM_ATOMIC_TYPE atomic; } atomic_t;
>  
>  # define atomic_read(x) (int) ((x)->atomic)
> -# define atomic_set(x, val) ((x)->atomic = (_ATOMIC_TYPE)(val))
> +# define atomic_set(x, val) ((x)->atomic = (LIBDRM_ATOMIC_TYPE)(val))
>  # define atomic_inc(x) (atomic_inc_uint (&(x)->atomic))
>  # define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 0)
>  # define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v)))
>  # define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v)))
>  # define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, newv)
>  
> -#undef _ATOMIC_TYPE
>  #endif
>  
>  #if ! HAS_ATOMIC_OPS
> -- 
> 1.7.9.2
>
diff mbox

Patch

diff --git a/xf86atomic.h b/xf86atomic.h
index e794af8..8c4b696 100644
--- a/xf86atomic.h
+++ b/xf86atomic.h
@@ -81,22 +81,21 @@  typedef struct {
 #define HAS_ATOMIC_OPS 1
 
 #if defined(__NetBSD__)
-#define _ATOMIC_TYPE int
+#define LIBDRM_ATOMIC_TYPE int
 #else
-#define _ATOMIC_TYPE uint_t
+#define LIBDRM_ATOMIC_TYPE uint_t
 #endif
 
-typedef struct { _ATOMIC_TYPE atomic; } atomic_t;
+typedef struct { LIBDRM_ATOMIC_TYPE atomic; } atomic_t;
 
 # define atomic_read(x) (int) ((x)->atomic)
-# define atomic_set(x, val) ((x)->atomic = (_ATOMIC_TYPE)(val))
+# define atomic_set(x, val) ((x)->atomic = (LIBDRM_ATOMIC_TYPE)(val))
 # define atomic_inc(x) (atomic_inc_uint (&(x)->atomic))
 # define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 0)
 # define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v)))
 # define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v)))
 # define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, newv)
 
-#undef _ATOMIC_TYPE
 #endif
 
 #if ! HAS_ATOMIC_OPS