commit 99c787631013bacf71c27dcac16d5a55b82be1c2
Author:     David Phillips <da...@sighup.nz>
AuthorDate: Mon Jul 2 19:42:41 2018 +1200
Commit:     Michael Forney <mfor...@mforney.org>
CommitDate: Tue Sep 25 19:31:01 2018 -0700

    On glibc, include sysmacros.h directly
    
    On glibc, major, minor, and makedev are all defined in
    sys/sysmacros.h with types.h only including this for historical
    reasons. A future release of glibc will remove this behaviour,
    meaning that major, minor, and makedev will no longer be defined
    for us without including sysmacros.h.

diff --git a/ls.c b/ls.c
index b716aba..7de15ac 100644
--- a/ls.c
+++ b/ls.c
@@ -1,6 +1,9 @@
 /* See LICENSE file for copyright and license details. */
 #include <sys/stat.h>
 #include <sys/types.h>
+#ifdef __GLIBC__
+#include <sys/sysmacros.h>
+#endif
 
 #include <dirent.h>
 #include <grp.h>
diff --git a/tar.c b/tar.c
index a6ead2e..fb0df45 100644
--- a/tar.c
+++ b/tar.c
@@ -1,6 +1,10 @@
 /* See LICENSE file for copyright and license details. */
 #include <sys/stat.h>
 #include <sys/time.h>
+#include <sys/types.h>
+#ifdef __GLIBC__
+#include <sys/sysmacros.h>
+#endif
 
 #include <errno.h>
 #include <fcntl.h>

Reply via email to