Re: [hackers] [PATCH] [sbase] Include sysmacros.h directly rather than types.h

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Mon, 2 Jul 2018 10:02:09 +0200

On Mon, Jul 02, 2018 at 07:48:03PM +1200, David Phillips wrote:
> 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.
> ---
> ls.c | 2 +-
> tar.c | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ls.c b/ls.c
> index b716aba..884776f 100644
> --- a/ls.c
> +++ b/ls.c
> _AT_@ -1,6 +1,6 @@
> /* See LICENSE file for copyright and license details. */
> #include <sys/stat.h>
> -#include <sys/types.h>
> +#include <sys/sysmacros.h>
>
> #include <dirent.h>
> #include <grp.h>
> diff --git a/tar.c b/tar.c
> index a6ead2e..9359bfd 100644
> --- a/tar.c
> +++ b/tar.c
> _AT_@ -1,6 +1,7 @@
> /* See LICENSE file for copyright and license details. */
> #include <sys/stat.h>
> #include <sys/time.h>
> +#include <sys/sysmacros.h>
>
> #include <errno.h>
> #include <fcntl.h>
> --
> 2.17.1
>
>

Did you test it with musl too and preferably other platforms?

-- 
Kind regards,
Hiltjo
Received on Mon Jul 02 2018 - 10:02:09 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 02 2018 - 10:12:24 CEST