Skip to content

Commit 0d99e5b

Browse files
facontidavideclaude
andcommitted
Fix int64_t/uint64_t conversion on Windows
The convertFromString<int64_t> and convertFromString<uint64_t> functions were using 'long' and 'unsigned long' for parsing. On Windows, these types are 32-bit, causing conversion failures for values that exceed the 32-bit range. Changed to use int64_t/uint64_t directly for proper cross-platform 64-bit integer handling. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ad7d74e commit 0d99e5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/basic_types.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ std::string convertFromString<std::string>(StringView str)
120120
template <>
121121
int64_t convertFromString<int64_t>(StringView str)
122122
{
123-
long result = 0;
123+
int64_t result = 0;
124124
const auto [ptr, ec] = std::from_chars(str.data(), str.data() + str.size(), result);
125125
std::ignore = ptr;
126126
if(ec != std::errc())
@@ -133,7 +133,7 @@ int64_t convertFromString<int64_t>(StringView str)
133133
template <>
134134
uint64_t convertFromString<uint64_t>(StringView str)
135135
{
136-
unsigned long result = 0;
136+
uint64_t result = 0;
137137
const auto [ptr, ec] = std::from_chars(str.data(), str.data() + str.size(), result);
138138
std::ignore = ptr;
139139
if(ec != std::errc())

0 commit comments

Comments
 (0)