Skip to content
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 compilation on DragonFlyBSD #2028

Merged
merged 3 commits into from
Jan 16, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/vibe/core/drivers/libevent2.d
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ version(Windows) {
}
else
import core.sys.freebsd.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
} else version (DragonFlyBSD) {
static if (__VERSION__ < 2077) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be 2079 ? Since it's not merged yet, and 2078 was already released.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You raising this question, made me think about this again. As this source is only going to be compiled/used when the changes have already landed in the compiler + druntime. It does make sense to even check the compiler version. I will remove this static if and just import core.sys.dragonflybsd.netinet.in_. There really is not need for the fall back.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow the comment of @Geod24 is shown as outdated, but he is right, this should be __VERSION__ < 2079 (or even later, if core.sys.dragonflybsd doesn't get merged into druntime master before 2.079)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See
No need to check the compiler version. It's like a chicken/egg issue, without compiler support there is not way to get to this code. When compiler support lands, then core.sys.dragonflybsd.netinet.in_ will exist.

enum IP_ADD_MEMBERSHIP = 12;
enum IP_MULTICAST_LOOP = 11;
}
else
import core.sys.dragonflybsd.netinet.in_ : IP_ADD_MEMBERSHIP, IP_MULTICAST_LOOP;
} else version (linux) {
static if (__VERSION__ < 2077) {
enum IP_ADD_MEMBERSHIP = 35;
Expand Down