File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 1212
1313//! Unix-specific networking functionality
1414
15+ #[ cfg( unix) ]
1516use libc;
1617
18+ // FIXME(#43348): Make libc adapt #[doc(cfg(...))] so we don't need these fake definitions here?
19+ #[ cfg( not( unix) ) ]
20+ mod libc {
21+ pub use libc:: c_int;
22+ pub type socklen_t = u32 ;
23+ pub struct sockaddr ;
24+ #[ derive( Clone ) ]
25+ pub struct sockaddr_un ;
26+ }
27+
1728use ascii;
1829use ffi:: OsStr ;
1930use fmt;
Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ pub const PIPE_READMODE_BYTE: DWORD = 0x00000000;
301301pub const FD_SETSIZE : usize = 64 ;
302302
303303#[ repr( C ) ]
304- #[ cfg( target_arch = "x86" ) ]
304+ #[ cfg( not ( target_pointer_width = "64" ) ) ]
305305pub struct WSADATA {
306306 pub wVersion : WORD ,
307307 pub wHighVersion : WORD ,
@@ -312,7 +312,7 @@ pub struct WSADATA {
312312 pub lpVendorInfo : * mut u8 ,
313313}
314314#[ repr( C ) ]
315- #[ cfg( target_arch = "x86_64 " ) ]
315+ #[ cfg( target_pointer_width = "64 " ) ]
316316pub struct WSADATA {
317317 pub wVersion : WORD ,
318318 pub wHighVersion : WORD ,
@@ -768,6 +768,14 @@ pub struct FLOATING_SAVE_AREA {
768768 _Dummy : [ u8 ; 512 ] // FIXME: Fill this out
769769}
770770
771+ // FIXME(#43348): This structure is used for backtrace only, and a fake
772+ // definition is provided here only to allow rustdoc to pass type-check. This
773+ // will not appear in the final documentation. This should be also defined for
774+ // other architectures supported by Windows such as ARM, and for historical
775+ // interest, maybe MIPS and PowerPC as well.
776+ #[ cfg( all( dox, not( any( target_arch = "x86_64" , target_arch = "x86" ) ) ) ) ]
777+ pub enum CONTEXT { }
778+
771779#[ repr( C ) ]
772780pub struct SOCKADDR_STORAGE_LH {
773781 pub ss_family : ADDRESS_FAMILY ,
You can’t perform that action at this time.
0 commit comments