c2rust
c2rust copied to clipboard
`#if __has_include` in macOS SDK headers causes fatal errors
On macOS Monterey + Xcode 14, system includes use #if __has_include. If the tested header file is missing, c2rust transpile reports a fatal error:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h:31:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h:136:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h:33:19: fatal error: cannot open file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalPrivate.h': No such file or directory
#if __has_include(<AvailabilityInternalPrivate.h>)
To reproduce:
#include <math.h>
This is a different issue from #561, because that's for using #if __has_include directly, and I'm still not sure if it's reproducible. This is with system headers. So I've unlinked it in the issue description.