Skip to content

Commit

Permalink
Fix error during cross-platform documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm committed Aug 12, 2017
1 parent b4114eb commit 3093bb8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/libstd/sys/unix/ext/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,19 @@

//! Unix-specific networking functionality
#[cfg(unix)]
use libc;

// FIXME(#43348): Make libc adapt #[doc(cfg(...))] so we don't need these fake definitions here?
#[cfg(not(unix))]
mod libc {
pub use libc::c_int;
pub type socklen_t = u32;
pub struct sockaddr;
#[derive(Clone)]
pub struct sockaddr_un;
}

use ascii;
use ffi::OsStr;
use fmt;
Expand Down
12 changes: 10 additions & 2 deletions src/libstd/sys/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ pub const PIPE_READMODE_BYTE: DWORD = 0x00000000;
pub const FD_SETSIZE: usize = 64;

#[repr(C)]
#[cfg(target_arch = "x86")]
#[cfg(not(target_pointer_width = "64"))]
pub struct WSADATA {
pub wVersion: WORD,
pub wHighVersion: WORD,
Expand All @@ -312,7 +312,7 @@ pub struct WSADATA {
pub lpVendorInfo: *mut u8,
}
#[repr(C)]
#[cfg(target_arch = "x86_64")]
#[cfg(target_pointer_width = "64")]
pub struct WSADATA {
pub wVersion: WORD,
pub wHighVersion: WORD,
Expand Down Expand Up @@ -768,6 +768,14 @@ pub struct FLOATING_SAVE_AREA {
_Dummy: [u8; 512] // FIXME: Fill this out
}

// FIXME(#43348): This structure is used for backtrace only, and a fake
// definition is provided here only to allow rustdoc to pass type-check. This
// will not appear in the final documentation. This should be also defined for
// other architectures supported by Windows such as ARM, and for historical
// interest, maybe MIPS and PowerPC as well.
#[cfg(all(dox, not(any(target_arch = "x86_64", target_arch = "x86"))))]
pub enum CONTEXT {}

#[repr(C)]
pub struct SOCKADDR_STORAGE_LH {
pub ss_family: ADDRESS_FAMILY,
Expand Down

0 comments on commit 3093bb8

Please sign in to comment.