Skip to content

Commit 1559687

Browse files
committed
Fix 1.13.0 support by gating use of target_vendor
To use the new devkitppc target, you need to enable the "target-vendor" feature. This requires rust 1.33 or higher.
1 parent 7318388 commit 1559687

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ std = []
2828
align = []
2929
rustc-dep-of-std = ['align', 'rustc-std-workspace-core']
3030
extra_traits = []
31+
target-vendor = []
3132
const-extern-fn = []
3233
# use_std is deprecated, use `std` instead
3334
use_std = [ 'std' ]

src/unix/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -596,11 +596,11 @@ extern "C" {
596596
pub fn getchar_unlocked() -> ::c_int;
597597
pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
598598

599-
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
599+
#[cfg(not(all(target_arch = "powerpc", feature = "target-vendor", target_vendor = "nintendo")))]
600600
#[cfg_attr(target_os = "netbsd", link_name = "__socket30")]
601601
#[cfg_attr(target_os = "illumos", link_name = "__xnet_socket")]
602602
pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
603-
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
603+
#[cfg(not(all(target_arch = "powerpc", feature = "target-vendor", target_vendor = "nintendo")))]
604604
#[cfg_attr(
605605
all(target_os = "macos", target_arch = "x86"),
606606
link_name = "connect$UNIX2003"
@@ -616,7 +616,7 @@ extern "C" {
616616
link_name = "listen$UNIX2003"
617617
)]
618618
pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
619-
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
619+
#[cfg(not(all(target_arch = "powerpc", feature = "target-vendor", target_vendor = "nintendo")))]
620620
#[cfg_attr(
621621
all(target_os = "macos", target_arch = "x86"),
622622
link_name = "accept$UNIX2003"
@@ -626,7 +626,7 @@ extern "C" {
626626
address: *mut sockaddr,
627627
address_len: *mut socklen_t,
628628
) -> ::c_int;
629-
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
629+
#[cfg(not(all(target_arch = "powerpc", feature = "target-vendor", target_vendor = "nintendo")))]
630630
#[cfg_attr(
631631
all(target_os = "macos", target_arch = "x86"),
632632
link_name = "getpeername$UNIX2003"
@@ -636,7 +636,7 @@ extern "C" {
636636
address: *mut sockaddr,
637637
address_len: *mut socklen_t,
638638
) -> ::c_int;
639-
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
639+
#[cfg(not(all(target_arch = "powerpc", feature = "target-vendor", target_vendor = "nintendo")))]
640640
#[cfg_attr(
641641
all(target_os = "macos", target_arch = "x86"),
642642
link_name = "getsockname$UNIX2003"
@@ -664,7 +664,7 @@ extern "C" {
664664
protocol: ::c_int,
665665
socket_vector: *mut ::c_int,
666666
) -> ::c_int;
667-
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
667+
#[cfg(not(all(target_arch = "powerpc", feature = "target-vendor", target_vendor = "nintendo")))]
668668
#[cfg_attr(
669669
all(target_os = "macos", target_arch = "x86"),
670670
link_name = "sendto$UNIX2003"
@@ -1240,15 +1240,15 @@ extern "C" {
12401240
pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
12411241
pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int;
12421242

1243-
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
1243+
#[cfg(not(all(target_arch = "powerpc", feature = "target-vendor", target_vendor = "nintendo")))]
12441244
#[cfg_attr(target_os = "illumos", link_name = "__xnet_getaddrinfo")]
12451245
pub fn getaddrinfo(
12461246
node: *const c_char,
12471247
service: *const c_char,
12481248
hints: *const addrinfo,
12491249
res: *mut *mut addrinfo,
12501250
) -> ::c_int;
1251-
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
1251+
#[cfg(not(all(target_arch = "powerpc", feature = "target-vendor", target_vendor = "nintendo")))]
12521252
pub fn freeaddrinfo(res: *mut addrinfo);
12531253
pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
12541254
#[cfg_attr(

src/unix/newlib/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ extern "C" {
600600
pub fn rand() -> ::c_int;
601601
pub fn srand(seed: ::c_uint);
602602

603-
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
603+
#[cfg(not(all(target_arch = "powerpc", feature = "target-vendor", target_vendor = "nintendo")))]
604604
pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t)
605605
-> ::c_int;
606606
pub fn clock_settime(
@@ -617,7 +617,7 @@ extern "C" {
617617
) -> ::c_int;
618618
pub fn closesocket(sockfd: ::c_int) -> ::c_int;
619619
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
620-
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
620+
#[cfg(not(all(target_arch = "powerpc", feature = "target-vendor", target_vendor = "nintendo")))]
621621
pub fn recvfrom(
622622
fd: ::c_int,
623623
buf: *mut ::c_void,
@@ -626,7 +626,7 @@ extern "C" {
626626
addr: *mut sockaddr,
627627
addr_len: *mut socklen_t,
628628
) -> isize;
629-
#[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))]
629+
#[cfg(not(all(target_arch = "powerpc", feature = "target-vendor", target_vendor = "nintendo")))]
630630
pub fn getnameinfo(
631631
sa: *const sockaddr,
632632
salen: socklen_t,

0 commit comments

Comments
 (0)