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

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


GCC 7 complains about major() and minor():
    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>
---
 libkms/linux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libkms/linux.c b/libkms/linux.c
index 0b50777e..e063e2be 100644
--- a/libkms/linux.c
+++ b/libkms/linux.c
@@ -39,6 +39,7 @@
 #include <xf86drm.h>
 #include <string.h>
 #include <unistd.h>
+#include <sys/sysmacros.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #ifdef MAJOR_IN_MKDEV
-- 
Cheers,
  Eric



More information about the dri-devel mailing list