Skip to content

Commit 023a66f

Browse files
author
Dave Huseby
committed
This fixes the OpenBSD and Bitrig builds.
1 parent d1835ae commit 023a66f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/liblibc/lib.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ pub mod types {
12991299
pub mod posix01 {
13001300
use types::common::c95::{c_void};
13011301
use types::os::arch::c95::{c_char, c_int, size_t,
1302-
time_t, suseconds_t, c_long};
1302+
time_t, suseconds_t, c_long};
13031303
use types::os::arch::c99::{uintptr_t};
13041304

13051305
pub type pthread_t = uintptr_t;
@@ -1405,13 +1405,16 @@ pub mod types {
14051405
pub sa_data: [u8; 14],
14061406
}
14071407
#[repr(C)]
1408-
#[derive(Copy, Clone)] pub struct sockaddr_storage {
1408+
#[derive(Copy)] pub struct sockaddr_storage {
14091409
pub ss_len: u8,
14101410
pub ss_family: sa_family_t,
14111411
pub __ss_pad1: [u8; 6],
14121412
pub __ss_pad2: i64,
14131413
pub __ss_pad3: [u8; 240],
14141414
}
1415+
impl ::core::clone::Clone for sockaddr_storage {
1416+
fn clone(&self) -> sockaddr_storage { *self }
1417+
}
14151418
#[repr(C)]
14161419
#[derive(Copy, Clone)] pub struct sockaddr_in {
14171420
pub sin_len: u8,
@@ -1459,11 +1462,14 @@ pub mod types {
14591462
pub ai_next: *mut addrinfo,
14601463
}
14611464
#[repr(C)]
1462-
#[derive(Copy, Clone)] pub struct sockaddr_un {
1465+
#[derive(Copy)] pub struct sockaddr_un {
14631466
pub sun_len: u8,
14641467
pub sun_family: sa_family_t,
14651468
pub sun_path: [c_char; 104]
14661469
}
1470+
impl ::core::clone::Clone for sockaddr_un {
1471+
fn clone(&self) -> sockaddr_un { *self }
1472+
}
14671473
#[repr(C)]
14681474
#[derive(Copy, Clone)] pub struct ifaddrs {
14691475
pub ifa_next: *mut ifaddrs,
@@ -4306,7 +4312,7 @@ pub mod consts {
43064312
pub const MAP_FIXED : c_int = 0x0010;
43074313
pub const MAP_ANON : c_int = 0x1000;
43084314

4309-
pub const MAP_FAILED : *mut c_void = -1 as *mut c_void;
4315+
pub const MAP_FAILED : *mut c_void = -(1 as c_int) as *mut c_void;
43104316

43114317
pub const MCL_CURRENT : c_int = 0x0001;
43124318
pub const MCL_FUTURE : c_int = 0x0002;

0 commit comments

Comments
 (0)