* [PATCH libdrm] xf86drm: fix return type for drmIsMaster()
@ 2019-02-08 15:02 Eric Engestrom
2019-02-08 16:51 ` Daniel Stone
0 siblings, 1 reply; 4+ messages in thread
From: Eric Engestrom @ 2019-02-08 15:02 UTC (permalink / raw)
To: dri-devel; +Cc: Christopher James Halse Rogers, Emil Velikov
Xserver has struct members named `bool`, which means the last commit
breaks its build with errors like this:
error: two or more data types in declaration specifiers
Bool bool;
^
Fix this by making it return a 0/1 integer, with the same semantic as
the boolean it was before.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=109587
Fixes: 17dfe3ac93217b43f93b "xf86drm: Add drmIsMaster()"
Cc: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Cc: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
---
xf86drm.c | 2 +-
xf86drm.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/xf86drm.c b/xf86drm.c
index 54695fcd5d1967574b00..05331c6d15bdd15b4be5 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -2724,7 +2724,7 @@ drm_public int drmDropMaster(int fd)
return drmIoctl(fd, DRM_IOCTL_DROP_MASTER, NULL);
}
-drm_public bool drmIsMaster(int fd)
+drm_public int drmIsMaster(int fd)
{
/* Detect master by attempting something that requires master.
*
diff --git a/xf86drm.h b/xf86drm.h
index b31ec9b5673a717bd6f3..9666a12c36bf28996157 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -746,7 +746,7 @@ extern void drmMsg(const char *format, ...) DRM_PRINTFLIKE(1, 2);
extern int drmSetMaster(int fd);
extern int drmDropMaster(int fd);
-extern bool drmIsMaster(int fd);
+extern int drmIsMaster(int fd);
#define DRM_EVENT_CONTEXT_VERSION 4
--
Cheers,
Eric
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH libdrm] xf86drm: fix return type for drmIsMaster()
2019-02-08 16:51 ` Daniel Stone
@ 2019-02-08 16:50 ` Emil Velikov
2019-02-08 18:50 ` Eric Engestrom
0 siblings, 1 reply; 4+ messages in thread
From: Emil Velikov @ 2019-02-08 16:50 UTC (permalink / raw)
To: Daniel Stone
Cc: Eric Engestrom, Christopher James Halse Rogers, dri-devel,
Emil Velikov
On Fri, 8 Feb 2019 at 16:51, Daniel Stone <daniel@fooishbar.org> wrote:
>
> Hi Eric,
>
> On Fri, 8 Feb 2019 at 15:03, Eric Engestrom <eric.engestrom@intel.com> wrote:
> > Xserver has struct members named `bool`, which means the last commit
> > breaks its build with errors like this:
> >
> > error: two or more data types in declaration specifiers
> > Bool bool;
> > ^
> >
> > Fix this by making it return a 0/1 integer, with the same semantic as
> > the boolean it was before.
>
> Don't you need to drop the stdbool.h include for this to fix compilation?
>
Thanks Eric. With Dan's comment
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
I really wonder if we cannot fix these trivial X nuisances? As-is
every project used has to either work around X mistakes :-(
Wrt libdrm that is fine, yet other projects might be less happy.
Thanks
-Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH libdrm] xf86drm: fix return type for drmIsMaster()
2019-02-08 15:02 [PATCH libdrm] xf86drm: fix return type for drmIsMaster() Eric Engestrom
@ 2019-02-08 16:51 ` Daniel Stone
2019-02-08 16:50 ` Emil Velikov
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Stone @ 2019-02-08 16:51 UTC (permalink / raw)
To: Eric Engestrom; +Cc: Christopher James Halse Rogers, dri-devel, Emil Velikov
Hi Eric,
On Fri, 8 Feb 2019 at 15:03, Eric Engestrom <eric.engestrom@intel.com> wrote:
> Xserver has struct members named `bool`, which means the last commit
> breaks its build with errors like this:
>
> error: two or more data types in declaration specifiers
> Bool bool;
> ^
>
> Fix this by making it return a 0/1 integer, with the same semantic as
> the boolean it was before.
Don't you need to drop the stdbool.h include for this to fix compilation?
Cheers,
Daniel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH libdrm] xf86drm: fix return type for drmIsMaster()
2019-02-08 16:50 ` Emil Velikov
@ 2019-02-08 18:50 ` Eric Engestrom
0 siblings, 0 replies; 4+ messages in thread
From: Eric Engestrom @ 2019-02-08 18:50 UTC (permalink / raw)
To: Emil Velikov; +Cc: dri-devel, Christopher James Halse Rogers, Emil Velikov
On Friday, 2019-02-08 16:50:44 +0000, Emil Velikov wrote:
> On Fri, 8 Feb 2019 at 16:51, Daniel Stone <daniel@fooishbar.org> wrote:
> >
> > Hi Eric,
> >
> > On Fri, 8 Feb 2019 at 15:03, Eric Engestrom <eric.engestrom@intel.com> wrote:
> > > Xserver has struct members named `bool`, which means the last commit
> > > breaks its build with errors like this:
> > >
> > > error: two or more data types in declaration specifiers
> > > Bool bool;
> > > ^
> > >
> > > Fix this by making it return a 0/1 integer, with the same semantic as
> > > the boolean it was before.
> >
> > Don't you need to drop the stdbool.h include for this to fix compilation?
Ahem... /me looks for his brown paper bag :]
> >
> Thanks Eric. With Dan's comment
> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
>
> I really wonder if we cannot fix these trivial X nuisances? As-is
> every project used has to either work around X mistakes :-(
> Wrt libdrm that is fine, yet other projects might be less happy.
Agreed :/
The issue is that you still won't be able to have bools in libdrm,
because a new libdrm might be used with an old xserver...
>
> Thanks
> -Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-02-08 18:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-08 15:02 [PATCH libdrm] xf86drm: fix return type for drmIsMaster() Eric Engestrom
2019-02-08 16:51 ` Daniel Stone
2019-02-08 16:50 ` Emil Velikov
2019-02-08 18:50 ` Eric Engestrom
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.