* [PATCH] libdrm: enclose __FreeBSD__ behind a define
@ 2020-05-19 19:04 Carlos Santa
2020-05-19 19:04 ` [PATCH libdrm] " Carlos Santa
0 siblings, 1 reply; 3+ messages in thread
From: Carlos Santa @ 2020-05-19 19:04 UTC (permalink / raw)
To: dri-devel; +Cc: Carlos Santa
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 <carlos.santa@intel.com>
---
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;
--
2.26.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH libdrm] libdrm: enclose __FreeBSD__ behind a define
2020-05-19 19:04 [PATCH] libdrm: enclose __FreeBSD__ behind a define Carlos Santa
@ 2020-05-19 19:04 ` Carlos Santa
2020-05-20 10:40 ` Emmanuel Vadot
0 siblings, 1 reply; 3+ messages in thread
From: Carlos Santa @ 2020-05-19 19:04 UTC (permalink / raw)
To: dri-devel; +Cc: Carlos Santa
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 <carlos.santa@intel.com>
---
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;
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH libdrm] libdrm: enclose __FreeBSD__ behind a define
2020-05-19 19:04 ` [PATCH libdrm] " Carlos Santa
@ 2020-05-20 10:40 ` Emmanuel Vadot
0 siblings, 0 replies; 3+ messages in thread
From: Emmanuel Vadot @ 2020-05-20 10:40 UTC (permalink / raw)
To: Carlos Santa; +Cc: dri-devel
On Tue, 19 May 2020 12:04:58 -0700
Carlos Santa <carlos.santa@intel.com> wrote:
> 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 <carlos.santa@intel.com>
> ---
> 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;
> --
> 2.20.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Ouch, sorry.
Reviewed-by: Emmanuel Vadot <manu@FreeBSD.org>
--
Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-20 10:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 19:04 [PATCH] libdrm: enclose __FreeBSD__ behind a define Carlos Santa
2020-05-19 19:04 ` [PATCH libdrm] " Carlos Santa
2020-05-20 10:40 ` Emmanuel Vadot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).