Skip to content

Commit 4a5ce60

Browse files
joshtripletttgross35
authored andcommitted
Require rust >= 1.33 and drop libc_cfg_target_vendor conditional
[ resolve conflicts - Trevor ]
1 parent 9b844ae commit 4a5ce60

File tree

3 files changed

+12
-62
lines changed

3 files changed

+12
-62
lines changed

build.rs

-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
1414
"freebsd13",
1515
"freebsd14",
1616
"freebsd15",
17-
"libc_cfg_target_vendor",
1817
"libc_const_extern_fn",
1918
"libc_const_extern_fn_unstable",
2019
"libc_deny_warnings",
@@ -84,11 +83,6 @@ fn main() {
8483
set_cfg("libc_deny_warnings");
8584
}
8685

87-
// Rust >= 1.33 supports cfg(target_vendor).
88-
if rustc_minor_ver >= 33 || rustc_dep_of_std {
89-
set_cfg("libc_cfg_target_vendor");
90-
}
91-
9286
// Rust >= 1.40 supports #[non_exhaustive].
9387
if rustc_minor_ver >= 40 || rustc_dep_of_std {
9488
set_cfg("libc_non_exhaustive");

src/unix/mod.rs

+8-40
Original file line numberDiff line numberDiff line change
@@ -642,21 +642,13 @@ extern "C" {
642642
pub fn getchar_unlocked() -> ::c_int;
643643
pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
644644

645-
#[cfg(not(all(
646-
libc_cfg_target_vendor,
647-
target_arch = "powerpc",
648-
target_vendor = "nintendo"
649-
)))]
645+
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
650646
#[cfg_attr(target_os = "netbsd", link_name = "__socket30")]
651647
#[cfg_attr(target_os = "illumos", link_name = "__xnet_socket")]
652648
#[cfg_attr(target_os = "solaris", link_name = "__xnet7_socket")]
653649
#[cfg_attr(target_os = "espidf", link_name = "lwip_socket")]
654650
pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
655-
#[cfg(not(all(
656-
libc_cfg_target_vendor,
657-
target_arch = "powerpc",
658-
target_vendor = "nintendo"
659-
)))]
651+
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
660652
#[cfg_attr(
661653
all(target_os = "macos", target_arch = "x86"),
662654
link_name = "connect$UNIX2003"
@@ -673,22 +665,14 @@ extern "C" {
673665
)]
674666
#[cfg_attr(target_os = "espidf", link_name = "lwip_listen")]
675667
pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
676-
#[cfg(not(all(
677-
libc_cfg_target_vendor,
678-
target_arch = "powerpc",
679-
target_vendor = "nintendo"
680-
)))]
668+
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
681669
#[cfg_attr(
682670
all(target_os = "macos", target_arch = "x86"),
683671
link_name = "accept$UNIX2003"
684672
)]
685673
#[cfg_attr(target_os = "espidf", link_name = "lwip_accept")]
686674
pub fn accept(socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> ::c_int;
687-
#[cfg(not(all(
688-
libc_cfg_target_vendor,
689-
target_arch = "powerpc",
690-
target_vendor = "nintendo"
691-
)))]
675+
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
692676
#[cfg_attr(
693677
all(target_os = "macos", target_arch = "x86"),
694678
link_name = "getpeername$UNIX2003"
@@ -699,11 +683,7 @@ extern "C" {
699683
address: *mut sockaddr,
700684
address_len: *mut socklen_t,
701685
) -> ::c_int;
702-
#[cfg(not(all(
703-
libc_cfg_target_vendor,
704-
target_arch = "powerpc",
705-
target_vendor = "nintendo"
706-
)))]
686+
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
707687
#[cfg_attr(
708688
all(target_os = "macos", target_arch = "x86"),
709689
link_name = "getsockname$UNIX2003"
@@ -736,11 +716,7 @@ extern "C" {
736716
protocol: ::c_int,
737717
socket_vector: *mut ::c_int,
738718
) -> ::c_int;
739-
#[cfg(not(all(
740-
libc_cfg_target_vendor,
741-
target_arch = "powerpc",
742-
target_vendor = "nintendo"
743-
)))]
719+
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
744720
#[cfg_attr(
745721
all(target_os = "macos", target_arch = "x86"),
746722
link_name = "sendto$UNIX2003"
@@ -1250,11 +1226,7 @@ extern "C" {
12501226
pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void;
12511227
pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
12521228

1253-
#[cfg(not(all(
1254-
libc_cfg_target_vendor,
1255-
target_arch = "powerpc",
1256-
target_vendor = "nintendo"
1257-
)))]
1229+
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
12581230
#[cfg_attr(
12591231
any(target_os = "illumos", target_os = "solaris"),
12601232
link_name = "__xnet_getaddrinfo"
@@ -1266,11 +1238,7 @@ extern "C" {
12661238
hints: *const addrinfo,
12671239
res: *mut *mut addrinfo,
12681240
) -> ::c_int;
1269-
#[cfg(not(all(
1270-
libc_cfg_target_vendor,
1271-
target_arch = "powerpc",
1272-
target_vendor = "nintendo"
1273-
)))]
1241+
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
12741242
#[cfg_attr(target_os = "espidf", link_name = "lwip_freeaddrinfo")]
12751243
pub fn freeaddrinfo(res: *mut addrinfo);
12761244
pub fn hstrerror(errcode: ::c_int) -> *const ::c_char;

src/unix/newlib/mod.rs

+4-16
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ s! {
9191

9292
#[cfg(not(any(
9393
target_os = "espidf",
94-
all(libc_cfg_target_vendor, target_arch = "powerpc", target_vendor = "nintendo"))))]
94+
all(target_arch = "powerpc", target_vendor = "nintendo"))))]
9595
pub ai_addr: *mut sockaddr,
9696

9797
pub ai_next: *mut addrinfo,
@@ -843,11 +843,7 @@ extern "C" {
843843
pub fn rand() -> ::c_int;
844844
pub fn srand(seed: ::c_uint);
845845

846-
#[cfg(not(all(
847-
libc_cfg_target_vendor,
848-
target_arch = "powerpc",
849-
target_vendor = "nintendo"
850-
)))]
846+
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
851847
#[cfg_attr(target_os = "espidf", link_name = "lwip_bind")]
852848
pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) -> ::c_int;
853849
pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
@@ -856,11 +852,7 @@ extern "C" {
856852
#[cfg_attr(target_os = "espidf", link_name = "lwip_close")]
857853
pub fn closesocket(sockfd: ::c_int) -> ::c_int;
858854
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
859-
#[cfg(not(all(
860-
libc_cfg_target_vendor,
861-
target_arch = "powerpc",
862-
target_vendor = "nintendo"
863-
)))]
855+
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
864856
#[cfg_attr(target_os = "espidf", link_name = "lwip_recvfrom")]
865857
pub fn recvfrom(
866858
fd: ::c_int,
@@ -870,11 +862,7 @@ extern "C" {
870862
addr: *mut sockaddr,
871863
addr_len: *mut socklen_t,
872864
) -> isize;
873-
#[cfg(not(all(
874-
libc_cfg_target_vendor,
875-
target_arch = "powerpc",
876-
target_vendor = "nintendo"
877-
)))]
865+
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
878866
pub fn getnameinfo(
879867
sa: *const sockaddr,
880868
salen: socklen_t,

0 commit comments

Comments
 (0)