diff --git a/builtin_printf.cpp b/builtin_printf.cpp index eca83e429..bdd1de097 100644 --- a/builtin_printf.cpp +++ b/builtin_printf.cpp @@ -234,19 +234,19 @@ void builtin_printf_state_t::verify_numeric(const wchar_t *s, const wchar_t *end template static T raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end); +// we use wcstoll instead of wcstoimax because FreeBSD 8 has busted wcstoumax and wcstoimax - see #626 template<> intmax_t raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end) { - return wcstoimax(s, end, 0); + return wcstoll(s, end, 0); } template<> uintmax_t raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end) { - return wcstoumax(s, end, 0); + return wcstoull(s, end, 0); } - template<> long double raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end) {