GCC 6.2.1 stops the build of qga/commands-posix.c with:

  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 #undef it after including <sys/types.h>.

Include <sys/sysmacros.h> for all users of <sys/types.h>.

Signed-off-by: Radim Krčmář <rkrc...@redhat.com>
 include/qemu/osdep.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 9e9fa6154642..fad31c3d5b56 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -64,6 +64,7 @@ extern int daemon(int, int);
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/types.h>
+#include <sys/sysmacros.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>

Reply via email to