fix: do not define feature test macros for BSD #126
Closed
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.
When trying to compile nextvi for freebsd the following error happens:
Browsing over web, I could found that can be fixed with the addition of __BSD_VISIBLE flag, but I also found alot of interesant info about of the subject and started to dig a lot more.
Take for example the following issue in the repo: nsf/termbox#110
rofl0r stated:
Now the following thread on freebsd mail list:
https://lists.freebsd.org/pipermail/freebsd-current/2018-May/069355.html
Stefan Hagen awnser himself:
and later Garrett Wollman:
Well, the subject itself is about D_XOPEN_SOURCE but it is the same for D_POSIX_C_SOURCE as I finally can state with this really nice thread:
https://lists.freebsd.org/pipermail/freebsd-standards/2004-March/000474.html
So in BSD system, we do not require D_POSIX_C_SOURCE.
D_BSD_SOURCE in thruth also does nothing for the system context:
My changes then, add D_POSIX_C_SOURCE as an requirement for linux and Darwin, and remove an BSD exclusive definition.
As Darwin and BSD are related, maybe this could be applied to it as well, but since I cant test it so my decision was to let it there.
I dont know if this will look reasonable for you, but I hope it can be a nice addition to the build process.
Thank you for the time.