Fix to include correct Availability.h header #40
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I believe I have discovered a very peculiar bug related to header names. First, a little background. The default filesystem on macOS Is a case-insensitive, case-preserving filesystem. This means that two files sharing the same case-insensitive name cannot exist in the same directory. For example, a directory cannot contain a filed named Test.txt and test.txt; they are, in fact, the same file. This is evident from the output of the "stat" command:
HFS and APFS can optionally be configured in a case-sensitive mode. Unlike the default case-insensitive, case-preserving mode, the file "Test.txt" and "test.txt" are uniquely separate inodes. If you have access to a case-sensitive filesystem, give it a try.
Now, I discovered that while packaging socket_vmnet for MacPorts, the port compiled successfully on my local system, but failed to compile on the MacPorts build systems. Thanks to some very clever MacPorts developers, it was disclosed that the MacPorts build systems use case-sensitive filesystems.
In
cli.c
, line 8, includes "availability.h". In actuality, the OS X SDK includes a file named "Availability.h" (not "availability.h"). On case-insensitive, case-preserving filesystems, this incorrect #include statement inadvertently still works due to the case-insensitivity. But it fails on case-sensitive filesystems.This PR edits the #include statement to include the file name as it is declared in the SDK: Availability.h.