1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
From c7d89412884de2dbfa543720d185027377e62f21 Mon Sep 17 00:00:00 2001
From: Heiko Thiery <heiko.thiery@gmail.com>
Date: Fri, 5 Jun 2020 23:46:52 +0200
Subject: [PATCH] xf86drm.c: fix build failure
./xf86drm.c: In function 'drmNodeIsDRM':
../xf86drm.c:2825:7: error: "__FreeBSD__" is not defined [-Werror=undef]
#elif __FreeBSD__
^
../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__
^
../xf86drm.c: In function 'drmParsePciDeviceInfo':
../xf86drm.c:3427:7: error: "__FreeBSD__" is not defined [-Werror=undef]
#elif __FreeBSD__
^
../xf86drm.c: In function 'drmGetDeviceNameFromFd2':
../xf86drm.c:4305:7: error: "__FreeBSD__" is not defined [-Werror=undef]
#elif __FreeBSD__
^
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Upstream-Status: Backport
Signed-off-by: Armin Kuster <akuster@mvista.com>
---
xf86drm.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/xf86drm.c b/xf86drm.c
index 07a18c4..50a6f09 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;
--
1.8.3.1
|