Fix build on FreeBSD#815
Merged
Conversation
Author
|
An alternative solution might be to use the errno crate to access |
Contributor
|
Hi, thanks for the PR! Just as a stylistic nitpick, maybe it'd be better to just rename the imports, to avoid littering I'm thinking something like: #[cfg(target_os = "linux")]
use libc::__errno_location;
#[cfg(target_os = "freebsd")]
use libc::__error as __errno_location;
#[cfg(any(target_os = "netbsd", target_os = "openbsd"))]
use libc::__errno as __errno_location;Do we have any strong stylistic constraints wrt to this ? @francesca64 @Osspial ? |
Author
|
I've changed it as you've suggested. Anything else I can to do to get this merged? |
Contributor
|
The only thing I can see blocking this is a lack of changelog entry. We should be able to merge this once that's added in. |
Author
|
Added one. |
added 3 commits
March 21, 2019 19:13
error[E0432]: unresolved import `libc::__errno_location`
--> src/platform/linux/x11/mod.rs:22:85
|
22 | use libc::{select, fd_set, FD_SET, FD_ZERO, FD_ISSET, EINTR, EINVAL, ENOMEM, EBADF, __errno_location};
| ^^^^^^^^^^^^^^^^ no `__errno_location` in the root
__errno_location is called __error on FreeBSD and __errno on Open- and NetBSD.
Signed-off-by: Tobias Kortkamp <t@tobik.me>
Signed-off-by: Tobias Kortkamp <t@tobik.me>
Signed-off-by: Tobias Kortkamp <t@tobik.me>
elinorbgr
pushed a commit
to elinorbgr/winit
that referenced
this pull request
Apr 7, 2019
* Fix build on FreeBSD
error[E0432]: unresolved import `libc::__errno_location`
--> src/platform/linux/x11/mod.rs:22:85
|
22 | use libc::{select, fd_set, FD_SET, FD_ZERO, FD_ISSET, EINTR, EINVAL, ENOMEM, EBADF, __errno_location};
| ^^^^^^^^^^^^^^^^ no `__errno_location` in the root
__errno_location is called __error on FreeBSD and __errno on Open- and NetBSD.
Signed-off-by: Tobias Kortkamp <t@tobik.me>
* Import __error / __errno on *BSD as __errno_location
Signed-off-by: Tobias Kortkamp <t@tobik.me>
* Add changelog entry
Signed-off-by: Tobias Kortkamp <t@tobik.me>
elinorbgr
pushed a commit
to elinorbgr/winit
that referenced
this pull request
Apr 7, 2019
* Fix build on FreeBSD
error[E0432]: unresolved import `libc::__errno_location`
--> src/platform/linux/x11/mod.rs:22:85
|
22 | use libc::{select, fd_set, FD_SET, FD_ZERO, FD_ISSET, EINTR, EINVAL, ENOMEM, EBADF, __errno_location};
| ^^^^^^^^^^^^^^^^ no `__errno_location` in the root
__errno_location is called __error on FreeBSD and __errno on Open- and NetBSD.
Signed-off-by: Tobias Kortkamp <t@tobik.me>
* Import __error / __errno on *BSD as __errno_location
Signed-off-by: Tobias Kortkamp <t@tobik.me>
* Add changelog entry
Signed-off-by: Tobias Kortkamp <t@tobik.me>
felixrabe
pushed a commit
to felixrabe/winit
that referenced
this pull request
Jun 30, 2019
* Fix build on FreeBSD
error[E0432]: unresolved import `libc::__errno_location`
--> src/platform/linux/x11/mod.rs:22:85
|
22 | use libc::{select, fd_set, FD_SET, FD_ZERO, FD_ISSET, EINTR, EINVAL, ENOMEM, EBADF, __errno_location};
| ^^^^^^^^^^^^^^^^ no `__errno_location` in the root
__errno_location is called __error on FreeBSD and __errno on Open- and NetBSD.
Signed-off-by: Tobias Kortkamp <t@tobik.me>
* Import __error / __errno on *BSD as __errno_location
Signed-off-by: Tobias Kortkamp <t@tobik.me>
* Add changelog entry
Signed-off-by: Tobias Kortkamp <t@tobik.me>
kosyak
pushed a commit
to kosyak/winit
that referenced
this pull request
Jul 10, 2019
* Fix build on FreeBSD
error[E0432]: unresolved import `libc::__errno_location`
--> src/platform/linux/x11/mod.rs:22:85
|
22 | use libc::{select, fd_set, FD_SET, FD_ZERO, FD_ISSET, EINTR, EINVAL, ENOMEM, EBADF, __errno_location};
| ^^^^^^^^^^^^^^^^ no `__errno_location` in the root
__errno_location is called __error on FreeBSD and __errno on Open- and NetBSD.
Signed-off-by: Tobias Kortkamp <t@tobik.me>
* Import __error / __errno on *BSD as __errno_location
Signed-off-by: Tobias Kortkamp <t@tobik.me>
* Add changelog entry
Signed-off-by: Tobias Kortkamp <t@tobik.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
__errno_location is called __error on FreeBSD and __errno on Open- and NetBSD.
Note that I only tested on FreeBSD. The OpenBSD and NetBSD bits are a pure guess on my part based on libc documentation and their errno.h [2,3,4,5].
[1] FreeBSD: https://rust-lang.github.io/libc/x86_64-unknown-freebsd/libc/fn.__error.html
[2] NetBSD: https://rust-lang.github.io/libc/x86_64-unknown-netbsd/libc/fn.__errno.html
[3] NetBSD: https://github.com/NetBSD/src/blob/trunk/include/errno.h
[4] OpenBSD: https://rust-lang.github.io/libc/x86_64-unknown-openbsd/libc/fn.__errno.html
[5] OpenBSD: https://github.com/OpenBSD/src/blob/master/include/errno.h