From patchwork Tue May 19 19:04:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Santa, Carlos" X-Patchwork-Id: 11558589 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FF7D1391 for ; Tue, 19 May 2020 19:07:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 899AA207E8 for ; Tue, 19 May 2020 19:07:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 899AA207E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B75B56E37C; Tue, 19 May 2020 19:07:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id AF5486E37C for ; Tue, 19 May 2020 19:07:10 +0000 (UTC) IronPort-SDR: wE48zOcmyP/Vr90PwxexwT379dPDms5aDfe8Ka8DNmV4hcUgoZWvGRk7QraSnMTjoVESBYbF13 8t33Wv9yk8xQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2020 12:07:10 -0700 IronPort-SDR: 50RK9AIVUPrXPCXs4JJ18QIZe42FXHCUemhjsFQjp++n+ZjHsYMQ7Ai1Uz+63L0DGOmf1yhMxm AiuHoksWkG5A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,410,1583222400"; d="scan'208";a="343235784" Received: from miryad.jf.intel.com ([10.54.74.46]) by orsmga001.jf.intel.com with ESMTP; 19 May 2020 12:07:06 -0700 From: Carlos Santa To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm] libdrm: enclose __FreeBSD__ behind a define Date: Tue, 19 May 2020 12:04:58 -0700 Message-Id: <20200519190458.15260-2-carlos.santa@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519190458.15260-1-carlos.santa@intel.com> References: <20200519190458.15260-1-carlos.santa@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carlos Santa Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Not doing the above can cause compilation errors on platforms that don't define it. [1/25] Compiling C object 'drm@sha/xf86drm.c.o. FAILED: drm@sha/xf86drm.c.o ../xf86drm.c: In function 'drmGetMinorNameForFD': ../xf86drm.c:2938:7: error: "__FreeBSD__" is not defined [-Werror=undef] #elif __FreeBSD__ ^ ../xf86drm.c: In function 'drmParsePciBusInfo': ../xf86drm.c:3258:7 error: "__FreeBSD__" is not defined [-Werror=undef] #elif __FreeBSD__ ^ ../x86drm.c: In function 'drmParsePciDeviceInfo': ../x86drm.c:3427:7 error: "__FreeBSD__" is not defined [-Werror=undef] #elif __FreeBSD__ ../x86drm.c: In function 'drmGetDeviceNameFromFd2': ../xf86drm.c:4305:7 error: "__FreeBSD__" is not defined [-Werror=undef] #elif __FreeBSD__ ^ cc1: some warnigns being treated as errors ninja: build stopped: subcommand failed. Signed-off-by: Carlos Santa --- xf86drm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xf86drm.c b/xf86drm.c index b49d42f70dbe..3965b4be366d 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -2822,7 +2822,7 @@ static bool drmNodeIsDRM(int maj, int min) snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device/drm", maj, min); return stat(path, &sbuf) == 0; -#elif __FreeBSD__ +#elif defined(__FreeBSD__) char name[SPECNAMELEN]; if (!devname_r(makedev(maj, min), S_IFCHR, name, sizeof(name))) @@ -2935,7 +2935,7 @@ static char *drmGetMinorNameForFD(int fd, int type) closedir(sysdir); return NULL; -#elif __FreeBSD__ +#elif defined(__FreeBSD__) struct stat sbuf; char dname[SPECNAMELEN]; const char *mname; @@ -3255,7 +3255,7 @@ static int drmParsePciBusInfo(int maj, int min, drmPciBusInfoPtr info) info->func = pinfo.func; return 0; -#elif __FreeBSD__ +#elif defined(__FreeBSD__) return get_sysctl_pci_bus_info(maj, min, info); #else #warning "Missing implementation of drmParsePciBusInfo" @@ -3424,7 +3424,7 @@ static int drmParsePciDeviceInfo(int maj, int min, device->subdevice_id = pinfo.subdevice_id; return 0; -#elif __FreeBSD__ +#elif defined(__FreeBSD__) drmPciBusInfo info; struct pci_conf_io pc; struct pci_match_conf patterns[1]; @@ -4302,7 +4302,7 @@ drm_public char *drmGetDeviceNameFromFd2(int fd) free(value); return strdup(path); -#elif __FreeBSD__ +#elif defined(__FreeBSD__) return drmGetDeviceNameFromFd(fd); #else struct stat sbuf;