From patchwork Sat Feb 7 17:21:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Coopersmith X-Patchwork-Id: 5796391 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 74E96BF440 for ; Sat, 7 Feb 2015 17:21:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A170420123 for ; Sat, 7 Feb 2015 17:21:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 803E520122 for ; Sat, 7 Feb 2015 17:21:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3336789E46; Sat, 7 Feb 2015 09:21:16 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by gabe.freedesktop.org (Postfix) with ESMTP id 737B789E46 for ; Sat, 7 Feb 2015 09:21:14 -0800 (PST) Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t17HLCZe006066 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 7 Feb 2015 17:21:13 GMT Received: from also.us.oracle.com (also.us.oracle.com [10.132.136.78]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t17HLB7l017661; Sat, 7 Feb 2015 17:21:12 GMT From: Alan Coopersmith To: dri-devel@lists.freedesktop.org Subject: [PATCH:libdrm] Stop undefining _ATOMIC_TYPE in Solaris/NetBSD section of xf86atomic.h Date: Sat, 7 Feb 2015 09:21:06 -0800 Message-Id: <1423329666-12059-1-git-send-email-alan.coopersmith@oracle.com> X-Mailer: git-send-email 1.7.9.2 X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Cc: Thomas Klausner X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-By: Thomas Klausner --- 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