Skip to content

Commit fe69cf5

Browse files
committed
libstd: Fix parse_int function on MSVC
1 parent de2ddb6 commit fe69cf5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/source/pl/lib/std/string.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ namespace pl::lib::libstd::string {
6565
auto string = params[0].toString(false);
6666
auto base = u64(params[1].toUnsigned());
6767

68-
return wolv::util::from_chars<i128>(string, base).value_or(0);
68+
if constexpr (std::integral<i128>)
69+
return wolv::util::from_chars<i128>(string, base).value_or(0);
70+
else
71+
return wolv::util::from_chars<i64>(string, base).value_or(0);
72+
6973
});
7074

7175
/* parse_float(string) */

0 commit comments

Comments
 (0)