Stop including <sys/sysmacros.h> from <sys/types.h>.
<sys/types.h> unconditionally includes <sys/sysmacros.h>.
<sys/sysmacros.h> defines major, minor, and makedev. In the deprecated NDK
headers, these were inline functions. In the unified headers, they are
The inline functions would only collide with another function called major,
minor, or makedev but the macros will replace anything with a function-like
form such as definitions of class methods called major, minor, or makedev.
This causes code which has such definitions to fail to compile when moving
from the deprecated headers to the unified headers.
Resolve this by removing the transitive dependency. Folks who want
<sys/sysmacros.h> can ask for it explicitly (it's been in both bionic and
glibc for years, though I don't think macOS has it [as usual]).
diff --git a/libc/include/sys/types.h b/libc/include/sys/types.h
index 637ef02..26ad6a5 100644
@@ -131,8 +131,6 @@
typedef unsigned int uint;
#if defined(__USE_BSD) || defined(__BIONIC__) /* Historically bionic exposed these. */
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;