[PATCH libdrm 1/2] xf86drm: add missing include <sys/sysmacros.h>

Eric Engestrom eric.engestrom at imgtec.com
Thu Mar 16 13:56:41 UTC 2017


GCC 7 complains about major(), minor() and makedev():
    warning: In the GNU C Library, "major" is defined by <sys/sysmacros.h>.
    For historical compatibility, it is currently defined by <sys/types.h> as
    well, but we plan to remove this soon. To use "major", include
    <sys/sysmacros.h> directly. If you did not intend to use a system-defined
    macro "major", you should undefine it after including <sys/types.h>.

Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
 xf86drm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xf86drm.c b/xf86drm.c
index 88f86ed5..8f8dfb6e 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -48,6 +48,7 @@
 #include <limits.h>
 #include <signal.h>
 #include <time.h>
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #define stat_t struct stat
-- 
Cheers,
  Eric



More information about the dri-devel mailing list