Fix builtin_printf compilation on FreeBSD 8.x

https://github.com/fish-shell/fish-shell/issues/626
This commit is contained in:
ridiculousfish 2013-03-27 11:35:30 -07:00
parent b04e874e43
commit 37140d5e10

View file

@ -234,19 +234,19 @@ void builtin_printf_state_t::verify_numeric(const wchar_t *s, const wchar_t *end
template<typename T> template<typename T>
static T raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end); 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<> template<>
intmax_t raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end) 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<> template<>
uintmax_t raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end) 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<> template<>
long double raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end) long double raw_string_to_scalar_type(const wchar_t *s, wchar_t ** end)
{ {