From 8b2e43322cc6656cf4d0a25b4e5ec473e9de95af Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 21 Jun 2016 12:18:15 -0400 Subject: [PATCH] pull in sys/sysmacros.h when available 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 --- configure.ac | 2 +- libkms/linux.c | 3 +++ xf86drm.c | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a04ce877100c..ad7d807729dc 100644 --- a/configure.ac +++ b/configure.ac @@ -53,7 +53,7 @@ AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE AC_FUNC_ALLOCA -AC_CHECK_HEADERS([sys/mkdev.h sys/sysctl.h sys/select.h]) +AC_CHECK_HEADERS([sys/mkdev.h sys/sysmacros.h sys/sysctl.h sys/select.h]) # Initialize libtool LT_PREREQ([2.2]) diff --git a/libkms/linux.c b/libkms/linux.c index 6e0da830fd2d..04ec40eb21d4 100644 --- a/libkms/linux.c +++ b/libkms/linux.c @@ -44,6 +44,9 @@ #ifdef HAVE_SYS_MKDEV_H #include #endif +#ifdef HAVE_SYS_SYSMACROS_H +#include +#endif #include "libdrm_macros.h" #include "internal.h" diff --git a/xf86drm.c b/xf86drm.c index 804a4134e47d..e8b2d7e2f4e8 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -57,6 +57,9 @@ #ifdef HAVE_SYS_MKDEV_H # include /* defines major(), minor(), and makedev() on Solaris */ #endif +#ifdef HAVE_SYS_SYSMACROS_H +#include +#endif #include /* Not all systems have MAP_FAILED defined */ -- 2.8.2