sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

commit 39f92650d33d038be5c5429e37d2d0c624b6ab38
parent 7315b8686f3fcbf213113247bea980b0548ec66a
Author: Michael Forney <mforney@mforney.org>
Date:   Mon,  5 Aug 2019 10:13:11 -0700

ls, tar: Guard inclusion of sys/sysmacros.h by absence of `major` definition

Since musl 1.1.23, it too does not provide `major` and `minor` through
sys/types.h, so instead include sys/sysmacros.h based on the absence of
`major` rather than only on glibc.

Thanks to Rich Felker for the suggestion.

Diffstat:
Mls.c | 2+-
Mtar.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ls.c b/ls.c @@ -1,7 +1,7 @@ /* See LICENSE file for copyright and license details. */ #include <sys/stat.h> #include <sys/types.h> -#ifdef __GLIBC__ +#ifndef major #include <sys/sysmacros.h> #endif diff --git a/tar.c b/tar.c @@ -2,7 +2,7 @@ #include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> -#ifdef __GLIBC__ +#ifndef major #include <sys/sysmacros.h> #endif