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 function-like macros. 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]). Bug: https://github.com/android-ndk/ndk/issues/398 Test: builds Change-Id: If2921c7b5d979c3066f199f22c64d4d2f7bf6632
Loading
Please sign in to comment