Skip to content

Commit 24e3067

Browse files
committed
Do not use std::chars_format
* use the overload with base parameter instead of std::chars_format::hex which is not fully supported on some compilers
1 parent 77f0e66 commit 24e3067

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/scratch/value_functions_p.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ extern "C"
144144
return (str1.compare(str2) == 0);
145145
}
146146

147-
inline double value_hexToDec(const char *s, int n, bool *ok)
147+
inline long value_hexToDec(const char *s, int n, bool *ok)
148148
{
149149
if (ok)
150150
*ok = false;
@@ -159,8 +159,8 @@ extern "C"
159159
p++;
160160
}
161161

162-
double result = 0;
163-
auto [ptr, ec] = std::from_chars(s, s + n, result, std::chars_format::hex);
162+
long result = 0;
163+
auto [ptr, ec] = std::from_chars(s, s + n, result, 16);
164164

165165
if (ec == std::errc{} && ptr == s + n) {
166166
if (ok)

0 commit comments

Comments
 (0)