OSDN Git Service

pull in sys/sysmacros.h when available
authorMike Frysinger <vapier@gentoo.org>
Tue, 21 Jun 2016 16:18:15 +0000 (12:18 -0400)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 6 Jul 2016 15:58:38 +0000 (16:58 +0100)
This header provides major/minor/makedev funcs under most Linux C
libs.  Pull it in to fix building with newer versions that drop the
implicit include via sys/types.h.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94231
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
configure.ac
libkms/linux.c
xf86drm.c

index a04ce87..90fc455 100644 (file)
@@ -53,7 +53,8 @@ AC_USE_SYSTEM_EXTENSIONS
 AC_SYS_LARGEFILE
 AC_FUNC_ALLOCA
 
-AC_CHECK_HEADERS([sys/mkdev.h sys/sysctl.h sys/select.h])
+AC_HEADER_MAJOR
+AC_CHECK_HEADERS([sys/sysctl.h sys/select.h])
 
 # Initialize libtool
 LT_PREREQ([2.2])
index 6e0da83..69eb1aa 100644 (file)
 #include <unistd.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#ifdef HAVE_SYS_MKDEV_H
+#ifdef MAJOR_IN_MKDEV
 #include <sys/mkdev.h>
 #endif
+#ifdef MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
+#endif
 
 #include "libdrm_macros.h"
 #include "internal.h"
index e99f2e2..8a858ef 100644 (file)
--- a/xf86drm.c
+++ b/xf86drm.c
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <stdarg.h>
-#ifdef HAVE_SYS_MKDEV_H
-# include <sys/mkdev.h> /* defines major(), minor(), and makedev() on Solaris */
+#ifdef MAJOR_IN_MKDEV
+#include <sys/mkdev.h>
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
 #endif
 #include <math.h>