-
Notifications
You must be signed in to change notification settings - Fork 536
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
Do not define _XOPEN_SOURCE and _POSIX_C_SOURCE, when using non-POSIX features #4
Comments
According to that page the macro's effects are cumulative; "symbols not required or explicitly permitted [...] shall not be made visible, except when enabled by another feature test macro". So the build enables C99 ( |
sys/soundcard.h is an implementation specific detail to the OS. When it comes to OSS support, soundcard.h would be the favoured choice, since this is what the 4Front OSS documentation wants one to use. You can't rely on sys/soundcard.h, since its contents and definitions may vary from OS to OS and version to version. sys/soundcard.h is not covered by POSIX or its XSI extension and thus left to the vendor, __BSD_VISIBLE would enable BSD-specific bits, which however may conflict with POSIX or XSI and cause undefined behaviour, if you use implementation bits of FreeBSD. Having said all that, wouldn't it be better to
This also would allow people to use 4Front's official OSS implementation, which hides OS-specific bits well enough from the API interfaces. |
POSIX has to be enabled for non-Windows builds, for pthreads and such. I'm not exactly sure what XSI is needed for, though. In either case, does changing |
Not on FreeBSD - there everything works without the feature macros. In my experience they are only really needed for glibc (although there may well be other *nix platforms that also need them). I have successfully (cross-)compiled 1.16.0 for FreeBSD with the following patch: Note that the header for |
Can you check current master? I've tried adding a check for if _POSIX_C_SOURCE is needed (and removed the need for _XOPEN_SOURCE altogether). |
master builds fine for me without any patches with my FreeBSD cross-compiler toolchain. |
Great, then I suppose this is fixed with commit 4e6acfa. If someone's still having issues on FreeBSD, please open a new issue. |
See also kcat/openal-soft#4 (comment) May help with #105
-D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700
probably may cause non-Linux builds to break due to missing type definitions and functions. The switches are meant (as far as I understand the standard) to force conformance to POSIX and XSI, so everything not covered is not supposed to work until explicitly told otherwise (see http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html, second section, 3rd bullet point).Using both defines will cause FreeBSD to break building the OSS back-end due to missing
u_long
,u_char
type definitions, since those are not covered by the standard.The text was updated successfully, but these errors were encountered: