Skip to content

Commit 00641e3

Browse files
authored
Added int128/uint128 support (#55)
1 parent efe8c51 commit 00641e3

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/lib.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,8 @@ pub enum Type<'a> {
437437
Ulong(StorageClass),
438438
Int64(StorageClass),
439439
Uint64(StorageClass),
440+
Int128(StorageClass),
441+
Uint128(StorageClass),
440442
Wchar(StorageClass),
441443
Char8(StorageClass),
442444
Char16(StorageClass),
@@ -1349,6 +1351,8 @@ impl<'a> ParserState<'a> {
13491351
b'N' => Type::Bool(sc),
13501352
b'J' => Type::Int64(sc),
13511353
b'K' => Type::Uint64(sc),
1354+
b'L' => Type::Int128(sc),
1355+
b'M' => Type::Uint128(sc),
13521356
b'W' => Type::Wchar(sc),
13531357
b'Q' => Type::Char8(sc),
13541358
b'S' => Type::Char16(sc),
@@ -1357,8 +1361,8 @@ impl<'a> ParserState<'a> {
13571361
return Err(self.fail("unknown primitive type"));
13581362
}
13591363
},
1360-
_ => {
1361-
return Err(self.fail("unknown primitive type: {}"));
1364+
_c => {
1365+
return Err(self.fail("unknown primitive type"));
13621366
}
13631367
})
13641368
}
@@ -1784,6 +1788,22 @@ impl<'a> Serializer<'a> {
17841788
}
17851789
sc
17861790
}
1791+
Type::Int128(sc) => {
1792+
if self.flags.contains(DemangleFlags::MS_TYPENAMES) {
1793+
write!(self.w, "__int128")?;
1794+
} else {
1795+
write!(self.w, "int128_t")?;
1796+
}
1797+
sc
1798+
}
1799+
Type::Uint128(sc) => {
1800+
if self.flags.contains(DemangleFlags::MS_TYPENAMES) {
1801+
write!(self.w, "unsigned __int128")?;
1802+
} else {
1803+
write!(self.w, "uint128_t")?;
1804+
}
1805+
sc
1806+
}
17871807
Type::Wchar(sc) => {
17881808
write!(self.w, "wchar_t")?;
17891809
sc

0 commit comments

Comments
 (0)