Skip to content

Commit 3056379

Browse files
committed
transpile: add cases for macOS header typedefs
1 parent 47a12a4 commit 3056379

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

c2rust-transpile/src/c_ast/conversion.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,6 +1980,15 @@ impl ConversionContext {
19801980
"__int32_t" => CTypeKind::Int32,
19811981
"__int64_t" => CTypeKind::Int64,
19821982
"__int128_t" => CTypeKind::Int128,
1983+
// macOS stdint.h typedefs [u]intN_t directly:
1984+
"int8_t" => CTypeKind::Int8,
1985+
"int16_t" => CTypeKind::Int16,
1986+
"int32_t" => CTypeKind::Int32,
1987+
"int64_t" => CTypeKind::Int64,
1988+
"uint8_t" => CTypeKind::UInt8,
1989+
"uint16_t" => CTypeKind::UInt16,
1990+
"uint32_t" => CTypeKind::UInt32,
1991+
"uint64_t" => CTypeKind::UInt64,
19831992
_ => {
19841993
eprintln!("Unknown fixed-size type typedef {name}!");
19851994
return None;

0 commit comments

Comments
 (0)