From 3e8cc82d371b23303cd4f30e4bcc9c5ecb10ad11 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 21 Jun 2016 14:24:42 -0400 Subject: [PATCH] pull in headers for major/minor/makedev funcs Use the portable autoconf helper to figure out which header to include for these funcs. Linux C libs are moving to not implicitly include them via sys/types.h anymore, and other OS's have long required you to pull in the right header directly. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96618 Signed-off-by: Mike Frysinger --- configure.ac | 1 + lib/igt_sysfs.c | 9 +++++++++ tools/aubdump.c | 8 +++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0405c8b3375b..2e2c3ab7a7b0 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,7 @@ AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" = xyes]) # Checks for functions, headers, structures, etc. AC_HEADER_STDC +AC_HEADER_MAJOR AC_CHECK_HEADERS([termios.h linux/kd.h sys/kd.h libgen.h sys/io.h]) AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT #include diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c index 61b94c6478f2..7553eeb7e636 100644 --- a/lib/igt_sysfs.c +++ b/lib/igt_sysfs.c @@ -22,9 +22,12 @@ * */ +#include "config.h" + #include #include #include +#include #include #include #include @@ -32,6 +35,12 @@ #include #include #include +#ifdef MAJOR_IN_MKDEV +#include +#endif +#ifdef MAJOR_IN_SYSMACROS +#include +#endif #include #include "igt_sysfs.h" diff --git a/tools/aubdump.c b/tools/aubdump.c index e7f63e7bb85b..f7ae1ccdb662 100644 --- a/tools/aubdump.c +++ b/tools/aubdump.c @@ -21,7 +21,7 @@ * IN THE SOFTWARE. */ -#define _GNU_SOURCE /* for RTLD_NEXT */ +#include "config.h" #include #include @@ -38,6 +38,12 @@ #include #include #include +#ifdef MAJOR_IN_MKDEV +#include +#endif +#ifdef MAJOR_IN_SYSMACROS +#include +#endif #include #include "intel_aub.h" -- 2.8.2