-
Notifications
You must be signed in to change notification settings - Fork 479
Fix FreeBSD support #561
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
Fix FreeBSD support #561
Conversation
|
@swift-ci test |
|
FYI: some of this is already captured in #559. You may want to review that, and then perhaps some of this can be streamlined. In the alternative, maybe we can shard out some of the common stuff and leave the platform-specific stuff. |
| case 0: | ||
| return; | ||
| case ERANGE: /* A broken QoS was passed to kevent_id() */ | ||
| #if defined(__APPLE__) |
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.
We have DISPATCH_USE_KEVENT_QOS in src/event/event_config.h that might be more declarative here.
| case ERANGE: /* A broken QoS was passed to kevent_id() */ | ||
| #if defined(__APPLE__) | ||
| DISPATCH_INTERNAL_CRASH(ke->qos, "Invalid kevent priority"); | ||
| #else |
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.
kevent on FreeBSD won't return ERANGE here, so we shouldn't need to trap this.
| DISPATCH_INTERNAL_CRASH(0, "Invalid kevent priority"); | ||
| #endif | ||
| default: | ||
| #if HAVE_MACH |
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.
We actually don't need to wrap HAVE_MACH here; we can remove the conditional in src/init.c (see 72eb2b2). Keeping the logging would be useful.
| dux_type(du._du)->dst_kind, dou._dq, | ||
| dou._dq->dq_label ? dou._dq->dq_label : "<unknown>", | ||
| du._du->du_ident, du._du->du_ident, func); | ||
| (intptr_t)du._du->du_ident, (intptr_t)du._du->du_ident, func); |
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.
If we're going to cast here, we might as well choose uintmax_t (in the alternative, I had suggested on the other pr defining some custom format strings because the type of dispatch_unote_ident_t is platform defined, but casting is a reasonable alternative here.)
| #define __DISPATCH_INDIRECT__ | ||
|
|
||
| #ifdef __APPLE__ | ||
| #ifdef __APPLE__DISPATCH_USE_KEVENT_WORKLOOP |
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.
s/__APPLE__//?
| #endif | ||
| #endif | ||
|
|
||
| #if defined(__FreeBSD__) |
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.
This could be merged above and the #ifdefput in the function body.
| #endif | ||
|
|
||
| #if !os(Linux) && !os(Android) && !os(Windows) | ||
| #if !os(Linux) && !os(Android) && !os(Windows) && !os(FreeBSD) |
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.
...and then we're going to have to eventually && !os(OpenBSD) -- should we just bite the bullet and rewrite this os(macOS)? (throughout)
|
libdispatch port is back online Thanks for @fluffykhv |
|
Dispatch builds and the test suite is passing on FreeBSD. I'm going to go ahead and close this now. If there are additional changes needed, we can revive this PR if necessary. |
No description provided.