Skip to content

Commit 5685006

Browse files
committed
Auto merge of #1521 - Wind-River:master_rebase, r=gnzlbg
Fix building error at backtrace I get this error when builind backtrace: error[E0308]: mismatched types --> /folk/prj-rust-dev/bpang/ala-diab-pb19l/fix_bugs/latest/.cargo/git/checkouts/backtrace-rs-fb1f822361417489/e745627/src/symboli\ ze/dladdr.rs:38:73 | 38 | Some(SymbolName::new(slice::from_raw_parts(ptr, len))) | ^^^ expected usize, found u64 help: you can convert an `u64` to `usize` and panic if the converted value wouldn't fit It shows the 'size_t' is expected to be defined as "usize".
2 parents b17f22d + ea0a512 commit 5685006

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

src/vxworks/mod.rs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,11 @@ pub type c_ulonglong = u64;
2525
pub type intmax_t = i64;
2626
pub type uintmax_t = u64;
2727

28-
cfg_if! {
29-
if #[cfg(target_pointer_width = "32")] {
30-
pub type size_t = c_uint;
31-
pub type ssize_t = c_int;
32-
pub type ptrdiff_t = c_int;
33-
pub type intptr_t = c_int;
34-
pub type uintptr_t = c_uint;
35-
} else if #[cfg(target_pointer_width = "64")] {
36-
pub type size_t = c_ulonglong;
37-
pub type ssize_t = c_longlong;
38-
pub type ptrdiff_t = c_longlong;
39-
pub type intptr_t = c_longlong;
40-
pub type uintptr_t = c_ulonglong;
41-
} else {
42-
// Unknown target_pointer_width
43-
}
44-
}
28+
pub type uintptr_t = usize;
29+
pub type intptr_t = isize;
30+
pub type ptrdiff_t = isize;
31+
pub type size_t = ::uintptr_t;
32+
pub type ssize_t = ::intptr_t;
4533

4634
pub type pid_t = i32;
4735
pub type in_addr_t = u32;

0 commit comments

Comments
 (0)