File tree Expand file tree Collapse file tree 14 files changed +18
-196
lines changed Expand file tree Collapse file tree 14 files changed +18
-196
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
17
17
"libc_cfg_target_vendor" ,
18
18
"libc_const_extern_fn" ,
19
19
"libc_const_extern_fn_unstable" ,
20
- "libc_core_cvoid" ,
21
20
"libc_deny_warnings" ,
22
21
"libc_long_array" ,
23
22
"libc_non_exhaustive" ,
@@ -86,13 +85,6 @@ fn main() {
86
85
set_cfg ( "libc_deny_warnings" ) ;
87
86
}
88
87
89
- // Rust >= 1.30 supports `core::ffi::c_void`, so libc can just re-export it.
90
- // Otherwise, it defines an incompatible type to retaining
91
- // backwards-compatibility.
92
- if rustc_minor_ver >= 30 || rustc_dep_of_std {
93
- set_cfg ( "libc_core_cvoid" ) ;
94
- }
95
-
96
88
// Rust >= 1.33 supports repr(packed(N)) and cfg(target_vendor).
97
89
if rustc_minor_ver >= 33 || rustc_dep_of_std {
98
90
set_cfg ( "libc_packedN" ) ;
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ fn do_ctest() {
67
67
68
68
fn ctest_cfg ( ) -> ctest:: TestGenerator {
69
69
let mut cfg = ctest:: TestGenerator :: new ( ) ;
70
- let libc_cfgs = [ "libc_core_cvoid" , " libc_packedN", "libc_thread_local" ] ;
70
+ let libc_cfgs = [ "libc_packedN" , "libc_thread_local" ] ;
71
71
for f in & libc_cfgs {
72
72
cfg. cfg ( f, None ) ;
73
73
}
Original file line number Diff line number Diff line change 3
3
//! More functions and definitions can be found in the more specific modules
4
4
//! according to the platform in question.
5
5
6
+ use c_void;
7
+
6
8
// PUB_TYPE
7
9
8
10
pub type c_schar = i8 ;
@@ -4490,23 +4492,3 @@ cfg_if! {
4490
4492
// Unknown target_arch
4491
4493
}
4492
4494
}
4493
-
4494
- cfg_if ! {
4495
- if #[ cfg( libc_core_cvoid) ] {
4496
- pub use :: ffi:: c_void;
4497
- } else {
4498
- // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
4499
- // enable more optimization opportunities around it recognizing things
4500
- // like malloc/free.
4501
- #[ repr( u8 ) ]
4502
- #[ allow( missing_copy_implementations) ]
4503
- #[ allow( missing_debug_implementations) ]
4504
- pub enum c_void {
4505
- // Two dummy variants so the #[repr] attribute can be used.
4506
- #[ doc( hidden) ]
4507
- __variant1,
4508
- #[ doc( hidden) ]
4509
- __variant2,
4510
- }
4511
- }
4512
- }
Original file line number Diff line number Diff line change 1
1
//! Hermit C type definitions
2
2
3
+ use c_void;
4
+
3
5
cfg_if ! {
4
6
if #[ cfg( any( target_arch = "aarch64" , target_arch = "riscv64" ) ) ] {
5
7
pub type c_char = u8 ;
@@ -576,5 +578,3 @@ extern "C" {
576
578
#[ link_name = "sys_poll" ]
577
579
pub fn poll ( fds : * mut pollfd , nfds : nfds_t , timeout : i32 ) -> i32 ;
578
580
}
579
-
580
- pub use ffi:: c_void;
Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ cfg_if! {
46
46
#[ doc( hidden) ]
47
47
#[ allow( unused_imports) ]
48
48
use core:: clone:: Clone ;
49
- #[ cfg( libc_core_cvoid) ]
50
- #[ allow( unused_imports) ]
51
- use core:: ffi;
52
49
#[ allow( unused_imports) ]
53
50
use core:: fmt;
54
51
#[ allow( unused_imports) ]
@@ -64,6 +61,8 @@ use core::num;
64
61
#[ allow( unused_imports) ]
65
62
use core:: option:: Option ;
66
63
64
+ pub use core:: ffi:: c_void;
65
+
67
66
cfg_if ! {
68
67
if #[ cfg( windows) ] {
69
68
mod fixed_width_ints;
Original file line number Diff line number Diff line change 4
4
//! by the linker. Crates that use these definitions must, somewhere in the
5
5
//! crate graph, include a stub provider crate such as the `psp` crate.
6
6
7
+ use c_void;
8
+
7
9
pub type c_schar = i8 ;
8
10
pub type c_uchar = u8 ;
9
11
pub type c_short = i16 ;
@@ -27,26 +29,6 @@ pub type c_char = u8;
27
29
pub type c_long = i64 ;
28
30
pub type c_ulong = u64 ;
29
31
30
- cfg_if ! {
31
- if #[ cfg( libc_core_cvoid) ] {
32
- pub use :: ffi:: c_void;
33
- } else {
34
- // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
35
- // enable more optimization opportunities around it recognizing things
36
- // like malloc/free.
37
- #[ repr( u8 ) ]
38
- #[ allow( missing_copy_implementations) ]
39
- #[ allow( missing_debug_implementations) ]
40
- pub enum c_void {
41
- // Two dummy variants so the #[repr] attribute can be used.
42
- #[ doc( hidden) ]
43
- __variant1,
44
- #[ doc( hidden) ]
45
- __variant2,
46
- }
47
- }
48
- }
49
-
50
32
pub type SceKernelVTimerHandler = unsafe extern "C" fn (
51
33
uid : SceUid ,
52
34
arg1 : * mut SceKernelSysClock ,
Original file line number Diff line number Diff line change @@ -25,23 +25,3 @@ pub type c_ulong = u64;
25
25
26
26
pub const INT_MIN : c_int = -2147483648 ;
27
27
pub const INT_MAX : c_int = 2147483647 ;
28
-
29
- cfg_if ! {
30
- if #[ cfg( libc_core_cvoid) ] {
31
- pub use :: ffi:: c_void;
32
- } else {
33
- // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
34
- // enable more optimization opportunities around it recognizing things
35
- // like malloc/free.
36
- #[ repr( u8 ) ]
37
- #[ allow( missing_copy_implementations) ]
38
- #[ allow( missing_debug_implementations) ]
39
- pub enum c_void {
40
- // Two dummy variants so the #[repr] attribute can be used.
41
- #[ doc( hidden) ]
42
- __variant1,
43
- #[ doc( hidden) ]
44
- __variant2,
45
- }
46
- }
47
- }
Original file line number Diff line number Diff line change 2
2
//!
3
3
//! [SOLID]: https://solid.kmckk.com/
4
4
5
+ use c_void;
6
+
5
7
pub type c_schar = i8 ;
6
8
pub type c_uchar = u8 ;
7
9
pub type c_short = i16 ;
@@ -871,26 +873,6 @@ extern "C" {
871
873
pub fn lseek ( arg1 : c_int , arg2 : __off_t , arg3 : c_int ) -> __off_t ;
872
874
}
873
875
874
- cfg_if ! {
875
- if #[ cfg( libc_core_cvoid) ] {
876
- pub use :: ffi:: c_void;
877
- } else {
878
- // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
879
- // enable more optimization opportunities around it recognizing things
880
- // like malloc/free.
881
- #[ repr( u8 ) ]
882
- #[ allow( missing_copy_implementations) ]
883
- #[ allow( missing_debug_implementations) ]
884
- pub enum c_void {
885
- // Two dummy variants so the #[repr] attribute can be used.
886
- #[ doc( hidden) ]
887
- __variant1,
888
- #[ doc( hidden) ]
889
- __variant2,
890
- }
891
- }
892
- }
893
-
894
876
cfg_if ! {
895
877
if #[ cfg( target_arch = "aarch64" ) ] {
896
878
mod aarch64;
Original file line number Diff line number Diff line change @@ -27,23 +27,3 @@ pub type wchar_t = u32;
27
27
28
28
pub const INT_MIN : c_int = -2147483648 ;
29
29
pub const INT_MAX : c_int = 2147483647 ;
30
-
31
- cfg_if ! {
32
- if #[ cfg( libc_core_cvoid) ] {
33
- pub use :: ffi:: c_void;
34
- } else {
35
- // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
36
- // enable more optimization opportunities around it recognizing things
37
- // like malloc/free.
38
- #[ repr( u8 ) ]
39
- #[ allow( missing_copy_implementations) ]
40
- #[ allow( missing_debug_implementations) ]
41
- pub enum c_void {
42
- // Two dummy variants so the #[repr] attribute can be used.
43
- #[ doc( hidden) ]
44
- __variant1,
45
- #[ doc( hidden) ]
46
- __variant2,
47
- }
48
- }
49
- }
Original file line number Diff line number Diff line change 3
3
//! More functions and definitions can be found in the more specific modules
4
4
//! according to the platform in question.
5
5
6
+ use c_void;
7
+
6
8
pub type c_schar = i8 ;
7
9
pub type c_uchar = u8 ;
8
10
pub type c_short = i16 ;
@@ -1703,23 +1705,3 @@ cfg_if! {
1703
1705
// Unknown target_os
1704
1706
}
1705
1707
}
1706
-
1707
- cfg_if ! {
1708
- if #[ cfg( libc_core_cvoid) ] {
1709
- pub use :: ffi:: c_void;
1710
- } else {
1711
- // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
1712
- // enable more optimization opportunities around it recognizing things
1713
- // like malloc/free.
1714
- #[ repr( u8 ) ]
1715
- #[ allow( missing_copy_implementations) ]
1716
- #[ allow( missing_debug_implementations) ]
1717
- pub enum c_void {
1718
- // Two dummy variants so the #[repr] attribute can be used.
1719
- #[ doc( hidden) ]
1720
- __variant1,
1721
- #[ doc( hidden) ]
1722
- __variant2,
1723
- }
1724
- }
1725
- }
You can’t perform that action at this time.
0 commit comments