mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
Fix compile error on OpenBSD
This commit is contained in:
parent
d1f08d4944
commit
b08a962edb
@ -648,6 +648,16 @@ void format_long_safe(wchar_t buff[64], long val) {
|
||||
}
|
||||
}
|
||||
|
||||
void format_llong_safe(wchar_t buff[64], long long val) {
|
||||
unsigned long long uval = absolute_value(val);
|
||||
if (val >= 0) {
|
||||
format_safe_impl(buff, 64, uval);
|
||||
} else {
|
||||
buff[0] = '-';
|
||||
format_safe_impl(buff + 1, 63, uval);
|
||||
}
|
||||
}
|
||||
|
||||
void format_ullong_safe(wchar_t buff[64], unsigned long long val) {
|
||||
return format_safe_impl(buff, 64, val);
|
||||
}
|
||||
|
@ -329,6 +329,7 @@ void format_size_safe(char buff[128], unsigned long long sz);
|
||||
/// Writes out a long safely.
|
||||
void format_long_safe(char buff[64], long val);
|
||||
void format_long_safe(wchar_t buff[64], long val);
|
||||
void format_llong_safe(wchar_t buff[64], long long val);
|
||||
void format_ullong_safe(wchar_t buff[64], unsigned long long val);
|
||||
|
||||
/// "Narrows" a wide character string. This just grabs any ASCII characters and trunactes.
|
||||
|
@ -139,6 +139,12 @@ inline wcstring to_string(long x) {
|
||||
return wcstring(buff);
|
||||
}
|
||||
|
||||
inline wcstring to_string(long long x) {
|
||||
wchar_t buff[64];
|
||||
format_llong_safe(buff, x);
|
||||
return wcstring(buff);
|
||||
}
|
||||
|
||||
inline wcstring to_string(unsigned long long x) {
|
||||
wchar_t buff[64];
|
||||
format_ullong_safe(buff, x);
|
||||
|
Loading…
x
Reference in New Issue
Block a user