Explicitly include sys/sysmacros.h for makedev etc

This header used to be included by sys/types.h in glibc, and musl
adopted the behaviour. However, this dependency was never desired, so
glibc deprecated it in 2016 and finally removed it in 2019, and so did
musl. Explicitly including the header should be a no-op on older libc
versions and fixes the build on newer versions.

https://sourceware.org/bugzilla/show_bug.cgi?id=19239
https://git.musl-libc.org/cgit/musl/commit/?id=f552c79
This commit is contained in:
Markus Rudy 2023-09-22 10:06:21 +02:00 committed by Roberto E. Vargas Caballero
parent 3c88778c6c
commit a015607af0
4 changed files with 4 additions and 0 deletions

View File

@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#include <sys/sysmacros.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -1,5 +1,6 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/sysmacros.h>
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,5 +1,6 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/sysmacros.h>
#include <sys/types.h> #include <sys/types.h>
#include <mntent.h> #include <mntent.h>

1
stat.c
View File

@ -1,5 +1,6 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/sysmacros.h>
#include <sys/types.h> #include <sys/types.h>
#include <inttypes.h> #include <inttypes.h>