-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[macOS] v. 5.9.7 broken on macOS < 10.13: if_dl.h: error: unknown type name 'u_char'; did you mean 'char'?
#2360
Comments
In old versions of macOS, net/if_dl.h neglects to include sys/types.h, which results in build failure: error: unknown type name 'u_char'; did you mean 'char'? Including net/if.h first works around the problem because net/if.h includes sys/types.h. Fixes giampaolo#2360
Sergey also filed this with MacPorts where he noted that it builds fine on macOS 10.13 and later, but not on 10.12 and earlier. This suggested to me that maybe some system header that is automatically included on 10.13 and later that provides the definition of I found that old macOS system headers have a bug that net/if_df.h does not include sys/types.h, but net/if.h does, so including that headers before, rather than after, net/if_dl.h works around the problem; I submitted a PR for that. More generally, following the convention of including system headers in alphabetical order should minimize these kinds of problems. There are further build failures on old macOS systems after fixing this. I'll investigate and report that separately. |
In old versions of macOS, net/if_dl.h neglects to include sys/types.h, which results in build failure: error: unknown type name 'u_char'; did you mean 'char'? Including net/if.h first works around the problem because net/if.h includes sys/types.h. Fixes #2360
@ryandesign @giampaolo I see in notes elsewhere sahlberg/libnfs@381883d that Though |
5.9.7 fails to build now on multiple systems.
On buildbots with clang,
x86_64
:Locally with gcc, on
ppc
:It does something strange. First of all, Xcode is installed. Then, why it needs Xcode at all?
Finally, something got badly broken with headers, apparently. 5.9.5 built fine.
The text was updated successfully, but these errors were encountered: