Skip to content

Commit 7581246

Browse files
committed
Re-export c_char_def as c_char instead of defining c_char per target
1 parent 92ffa8c commit 7581246

File tree

101 files changed

+113
-117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+113
-117
lines changed

src/fuchsia/aarch64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
pub use crate::arch::c_char_def as c_char;
12
use crate::off_t;
23
use crate::prelude::*;
34

4-
pub type c_char = u8;
55
pub type __u64 = c_ulonglong;
66
pub type wchar_t = u32;
77
pub type nlink_t = c_ulong;

src/fuchsia/riscv64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
pub use crate::arch::c_char_def as c_char;
12
use crate::off_t;
23
use crate::prelude::*;
34

45
// From psABI Calling Convention for RV64
5-
pub type c_char = u8;
66
pub type __u64 = c_ulonglong;
77
pub type wchar_t = i32;
88

src/fuchsia/x86_64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
pub use crate::arch::c_char_def as c_char;
12
use crate::off_t;
23
use crate::prelude::*;
34

4-
pub type c_char = i8;
55
pub type wchar_t = i32;
66
pub type nlink_t = u64;
77
pub type blksize_t = c_long;

src/hermit.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
//! Hermit C type definitions
22
3+
pub use crate::arch::c_char_def as c_char;
34
use crate::prelude::*;
45

5-
cfg_if! {
6-
if #[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))] {
7-
pub type c_char = u8;
8-
} else {
9-
pub type c_char = i8;
10-
}
11-
}
12-
136
pub type c_schar = i8;
147
pub type c_uchar = u8;
158
pub type c_short = i16;

src/sgx.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! SGX C types definition
22
3+
pub use crate::arch::c_char_def as c_char;
4+
35
pub type c_schar = i8;
46
pub type c_uchar = u8;
57
pub type c_short = i16;
@@ -19,7 +21,6 @@ pub type intptr_t = isize;
1921
pub type uintptr_t = usize;
2022
pub type ssize_t = isize;
2123

22-
pub type c_char = i8;
2324
pub type c_long = i64;
2425
pub type c_ulong = u64;
2526

src/solid/aarch64.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
pub type c_char = i8;
21
pub type wchar_t = u32;
32
pub type c_long = i64;
43
pub type c_ulong = u64;

src/solid/arm.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
pub type c_char = i8;
21
pub type wchar_t = u32;
32
pub type c_long = i32;
43
pub type c_ulong = u32;

src/solid/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//!
33
//! [SOLID]: https://solid.kmckk.com/
44
5+
pub use crate::arch::c_char_def as c_char;
56
use crate::prelude::*;
67

78
pub type c_schar = i8;

src/switch.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Switch C type definitions
22
3+
pub use crate::arch::c_char_def as c_char;
4+
35
pub type c_schar = i8;
46
pub type c_uchar = u8;
57
pub type c_short = i16;
@@ -20,7 +22,6 @@ pub type uintptr_t = usize;
2022
pub type ssize_t = isize;
2123

2224
pub type off_t = i64;
23-
pub type c_char = u8;
2425
pub type c_long = i64;
2526
pub type c_ulong = u64;
2627
pub type wchar_t = u32;

src/teeos/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// only supported on Rust > 1.59, so we can directly reexport c_void from core.
99
pub use core::ffi::c_void;
1010

11+
pub use crate::arch::c_char_def as c_char;
1112
use crate::prelude::*;
1213

1314
pub type c_schar = i8;
@@ -48,9 +49,6 @@ pub type ssize_t = isize;
4849

4950
pub type pid_t = c_int;
5051

51-
// aarch64 specific
52-
pub type c_char = u8;
53-
5452
pub type wchar_t = u32;
5553

5654
pub type c_long = i64;

0 commit comments

Comments
 (0)