Skip to content

Commit

Permalink
xfree86: Silence a new glibc warning
Browse files Browse the repository at this point in the history
glibc would like to stop declaring major()/minor() macros in
<sys/types.h> because that header gets included absolutely everywhere
and unix device major/minor is perhaps usually not what's expected. Fair
enough. If one includes <sys/sysmacros.h> as well then glibc knows we
meant it and doesn't warn, so do that if it exists.

Signed-off-by: Adam Jackson <ajax@redhat.com>
  • Loading branch information
nwnk committed May 3, 2017
1 parent c3147a2 commit d732c36
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -132,7 +132,7 @@ 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/mkdev.h sys/utsname.h])
fnmatch.h sys/mkdev.h sys/sysmacros.h sys/utsname.h])

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
Expand Down
3 changes: 3 additions & 0 deletions hw/xfree86/common/xf86Xinput.c
Expand Up @@ -84,6 +84,9 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#ifdef HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>
#endif
#ifdef HAVE_SYS_MKDEV_H
#include <sys/mkdev.h> /* for major() & minor() on Solaris */
#endif
Expand Down
3 changes: 3 additions & 0 deletions hw/xfree86/os-support/linux/lnx_init.c
Expand Up @@ -38,6 +38,9 @@
#include "xf86_OSlib.h"

#include <sys/stat.h>
#ifdef HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>
#endif

#ifndef K_OFF
#define K_OFF 0x4
Expand Down
1 change: 1 addition & 0 deletions include/meson.build
Expand Up @@ -95,6 +95,7 @@ conf_data.set('HAVE_STROPTS_H', cc.has_header('stropts.h'))
conf_data.set('HAVE_SYS_AGPGART_H', cc.has_header('sys/agpgart.h'))
conf_data.set('HAVE_SYS_AGPIO_H', cc.has_header('sys/agpio.h'))
conf_data.set('HAVE_SYS_UTSNAME_H', cc.has_header('sys/utsname.h'))
conf_data.set('HAVE_SYS_SYSMACROS_H', cc.has_header('sys/sysmacros.h'))
conf_data.set('HAVE_UNISTD_H', cc.has_header('unistd.h'))

conf_data.set('HAVE_BACKTRACE', cc.has_function('backtrace'))
Expand Down
3 changes: 3 additions & 0 deletions include/xorg-config.h.in
Expand Up @@ -124,6 +124,9 @@
/* Define to 1 if you have the <sys/mkdev.h> header file. */
#undef HAVE_SYS_MKDEV_H

/* Define to 1 if you have the <sys/sysmacros.h> header file. */
#undef HAVE_SYS_SYSMACROS_H

/* Path to text files containing PCI IDs */
#undef PCI_TXT_IDS_PATH

Expand Down

0 comments on commit d732c36

Please sign in to comment.