Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 2fdc6d2

Browse files
Merge pull request #80 from EPashkin/fix_doc_build
Fix doc build
2 parents 18244f3 + 09c4691 commit 2fdc6d2

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ addons:
1313
script:
1414
- rustc --version
1515
- cargo test --features "embed-lgpl-docs v2_40" --jobs 1
16+
- cargo doc --features "dox"
1617
# catch any sneaked in lgpl docs
1718
- cargo build --features purge-lgpl-docs --jobs 1
1819
- git diff -R --exit-code

src/socket.rs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ use std::cell::RefCell;
1414
use std::mem::transmute;
1515
use Socket;
1616
use SocketAddress;
17+
#[cfg(all(not(unix), feature = "dox"))]
18+
use std::os::raw::c_int;
1719

18-
#[cfg(any(unix, feature = "dox"))]
20+
#[cfg(unix)]
1921
use std::os::unix::io::{IntoRawFd, FromRawFd};
2022

21-
#[cfg(any(windows, feature = "dox"))]
23+
#[cfg(windows)]
2224
use std::os::windows::io::{IntoRawSocket, FromRawSocket};
2325

2426
impl Socket {
@@ -222,3 +224,23 @@ fn into_raw<F: FnMut(&Socket, glib::IOCondition) -> glib::Continue + Send + 'sta
222224
Box::new(RefCell::new(Box::new(func)));
223225
Box::into_raw(func) as glib_ffi::gpointer
224226
}
227+
228+
#[cfg(all(not(unix), feature = "dox"))]
229+
pub trait IntoRawFd {
230+
fn into_raw_fd(self) -> c_int;
231+
}
232+
233+
#[cfg(all(not(unix), feature = "dox"))]
234+
pub trait FromRawFd {
235+
unsafe fn from_raw_fd(fd: c_int) -> Self;
236+
}
237+
238+
#[cfg(all(not(windows), feature = "dox"))]
239+
pub trait IntoRawSocket {
240+
fn into_raw_socket(self) -> u64;
241+
}
242+
243+
#[cfg(all(not(windows), feature = "dox"))]
244+
pub trait FromRawSocket {
245+
unsafe fn from_raw_socket(sock: u64) -> Self;
246+
}

0 commit comments

Comments
 (0)