diff mbox

[PATCH:libdrm] include <sys/sysmacros.h> directly for major() and minor()

Message ID 1436229925-18893-1-git-send-email-alan.coopersmith@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alan Coopersmith July 7, 2015, 12:45 a.m. UTC
Linux seems to pick this up via another header, but Solaris needs it
explictly included, or we get undefined symbol errors for major & minor.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
---
 libkms/linux.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Emil Velikov July 8, 2015, 4:19 p.m. UTC | #1
Hi Alan

On 7 July 2015 at 01:45, Alan Coopersmith <alan.coopersmith@oracle.com> wrote:
> Linux seems to pick this up via another header, but Solaris needs it
> explictly included, or we get undefined symbol errors for major & minor.
>
A slightly pedandic suggestion:
Can we use sys/types.h + sys/mkdev.h as the manpage suggests. We
already do so in xf86drm.c

Thanks
Emil
Alan Coopersmith July 8, 2015, 5:39 p.m. UTC | #2
On 07/ 8/15 09:19 AM, Emil Velikov wrote:
> Hi Alan
>
> On 7 July 2015 at 01:45, Alan Coopersmith <alan.coopersmith@oracle.com> wrote:
>> Linux seems to pick this up via another header, but Solaris needs it
>> explictly included, or we get undefined symbol errors for major & minor.
>>
> A slightly pedandic suggestion:
> Can we use sys/types.h + sys/mkdev.h as the manpage suggests. We
> already do so in xf86drm.c

Sure - I'd thought sysmacros.h was mentioned in a manpage, but can't find that 
now.  It builds fine with those instead, so v2 patch follows.
diff mbox

Patch

diff --git a/libkms/linux.c b/libkms/linux.c
index 4d47148..f1767c8 100644
--- a/libkms/linux.c
+++ b/libkms/linux.c
@@ -40,6 +40,7 @@ 
 #include <string.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 
 #include "libdrm_macros.h"
 #include "internal.h"