include <sys/types.h> & <sys/mkdev.h> directly for major() and minor()
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Wed, 8 Jul 2015 17:41:43 +0000 (10:41 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 13 Jul 2015 18:38:28 +0000 (19:38 +0100)
Linux seems to pick these up via another header, but Solaris needs them
explicitly included, or we get undefined symbol errors for major & minor.

v2: use headers documented in makedev(3C) man page instead of sysmacros.h

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
v3 [Emil Velikov]: include sys/mkdev.h only when available.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
libkms/linux.c

index 4d47148..b735527 100644 (file)
 #include <string.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <sys/types.h>
+#ifdef HAVE_SYS_MKDEV_H
+#include <sys/mkdev.h>
+#endif
 
 #include "libdrm_macros.h"
 #include "internal.h"