-
Notifications
You must be signed in to change notification settings - Fork 291
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
Portability Fixes #398
Portability Fixes #398
Conversation
|
@iphydf yeah, i noticed that sys/socket.h is included for macos, but that SO_NOSIGPIPE still isn't defined. |
I want to take a look at an actual os x install to be sure, but I don't have one :( |
Afaik you need to add conditions to the code using #if defined(SO_NOSIGPIPE) so you do not use it at all on OSX, because it really is not available on OSX (and on BSD too I think?). I remember that from my MediaTomb times which was very portable and which we had running on pretty much every linux/unix system. |
@jin-eld I think you've got it backward. SO_NOSIGPIPE is a macos and bsd thing, not available on linux, and definitely not defined in POSIX. i haven't looked at it yet, but i'd guess the issue is a missing feature-test macro, like iphy suggested. |
@Zer0-One Ooops :) Sorry... I guess it's been too long... somehow I remembered it the other way around. |
8cc3fc1
to
502261e
Compare
#define _DARWIN_C_SOURCE | ||
#include <mach/clock.h> | ||
#include <mach/mach.h> | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you moved this block so you don't need an extra block at the beginning. Would it work if you moved this block back to where it came from and #define _DARWIN_C_SOURCE
unconditionally together with _XOPEN_SOURCE
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
if you squash the commits I'll merge it. Sorting the feature test macros (darwin before xopen) would be nice, but it's ok if you can't do that now. Review status: 0 of 27 files reviewed at latest revision, 1 unresolved discussion. Comments from Reviewable |
This reverts commit 59e2a84, and defines _DARWIN_C_SOURCE in toxcore/network.c
done and done Review status: 0 of 27 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
Comments from Reviewable |
CMakeLists.txt, line 59 at r2 (raw file):
Remove the trailing whitespace. Comments from Reviewable |
This reverts commit 59e2a84.
This change is