From patchwork Wed Dec 11 21:17:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 3328371 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 508E1C0D4B for ; Wed, 11 Dec 2013 21:17:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 95807207CA for ; Wed, 11 Dec 2013 21:17:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DA346207EF for ; Wed, 11 Dec 2013 21:17:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EDC8CFA926 for ; Wed, 11 Dec 2013 13:17:35 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E63CFA80F; Wed, 11 Dec 2013 13:17:12 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id BF02F158402E; Wed, 11 Dec 2013 13:17:11 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from keithp.com ([127.0.0.1]) by localhost (keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xAHadI86RzpS; Wed, 11 Dec 2013 13:17:09 -0800 (PST) Received: by keithp.com (Postfix, from userid 1033) id EBD04158402C; Wed, 11 Dec 2013 13:17:08 -0800 (PST) Received: from miki.keithp.com (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id C7D3314A802D; Wed, 11 Dec 2013 13:17:08 -0800 (PST) Received: by miki.keithp.com (Postfix, from userid 1001) id 6BFE7BCF; Wed, 11 Dec 2013 13:17:08 -0800 (PST) From: Keith Packard To: mesa-dev@lists.freedesktop.org Subject: [PATCH] Mark drmServerInfo.debug_print with printf attribute Date: Wed, 11 Dec 2013 13:17:07 -0800 Message-Id: <1386796627-29167-1-git-send-email-keithp@keithp.com> X-Mailer: git-send-email 1.8.4.4 Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 I stole the conditional for _X_ATTRIBUTE_PRINTF from xproto and changed the name to _DRM_ATTRIBUTE_PRINTF to avoid future conflicts. Signed-off-by: Keith Packard --- xf86drm.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xf86drm.h b/xf86drm.h index 1e763a3..0bf205f 100644 --- a/xf86drm.h +++ b/xf86drm.h @@ -92,8 +92,15 @@ extern "C" { typedef unsigned int drmSize, *drmSizePtr; /**< For mapped regions */ typedef void *drmAddress, **drmAddressPtr; /**< For mapped regions */ +/* Added in X11R6.9, so available in any version of modular xproto */ +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203) +# define _DRM_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y))) +#else /* not gcc >= 2.3 */ +# define _DRM_ATTRIBUTE_PRINTF(x,y) +#endif + typedef struct _drmServerInfo { - int (*debug_print)(const char *format, va_list ap); + int (*debug_print)(const char *format, va_list ap) _DRM_ATTRIBUTE_PRINTF(1,0); int (*load_module)(const char *name); void (*get_perms)(gid_t *, mode_t *); } drmServerInfo, *drmServerInfoPtr;