[PATCH] Add necessary headers for major()/minor() on Solaris to xf86Xinput.c

Alan Coopersmith alan.coopersmith at oracle.com
Sat Mar 22 14:30:04 PDT 2014


Without these, after commit fdb4ec86c29d85c, it fails to build on Solaris,
with errors of:
xf86Xinput.c: In function 'xf86stat':
xf86Xinput.c:816:5: error: implicit declaration of function 'major' [-Werror=implicit-function-declaration]
xf86Xinput.c:817:5: error: implicit declaration of function 'minor' [-Werror=implicit-function-declaration]

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 configure.ac                   |    3 ++-
 hw/xfree86/common/xf86Xinput.c |    4 ++++
 include/xorg-config.h.in       |    3 +++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 5c8530c..278aaab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,7 +133,8 @@ AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"
 
 AC_HEADER_DIRENT
 AC_HEADER_STDC
-AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h fnmatch.h sys/utsname.h])
+AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h \
+ fnmatch.h sys/mkdev.h sys/utsname.h])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index a367ae3..bc6b73f 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -81,8 +81,12 @@
 
 #include <stdarg.h>
 #include <stdint.h>             /* for int64_t */
+#include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#ifdef HAVE_SYS_MKDEV_H
+#include <sys/mkdev.h>          /* for major() & minor() on Solaris */
+#endif
 
 #include "mi.h"
 
diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in
index 487d7ad..77a1aae 100644
--- a/include/xorg-config.h.in
+++ b/include/xorg-config.h.in
@@ -118,6 +118,9 @@
 /* Have execinfo.h */
 #undef HAVE_EXECINFO_H
 
+/* Define to 1 if you have the <sys/mkdev.h> header file. */
+#undef HAVE_SYS_MKDEV_H
+
 /* Path to text files containing PCI IDs */
 #undef PCI_TXT_IDS_PATH
 
-- 
1.7.9.2



More information about the xorg-devel mailing list