Commit 1bea8247 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Create *nix wrapper for MSVC's _i64toa()

parent d855e164
...@@ -601,6 +601,25 @@ char* ultoa(ulong val, char* str, int radix) ...@@ -601,6 +601,25 @@ char* ultoa(ulong val, char* str, int radix)
} }
return(str); return(str);
} }
char* _i64toa(int64_t val, char* str, int radix)
{
switch(radix) {
case 8:
sprintf(str,"%"PRIo64,val);
break;
case 10:
sprintf(str,"%"PRId64,val);
break;
case 16:
sprintf(str,"%"PRIx64,val);
break;
default:
sprintf(str,"bad radix: %d",radix);
break;
}
return str;
}
#endif #endif
/****************************************************************************/ /****************************************************************************/
......
...@@ -228,6 +228,7 @@ extern "C" { ...@@ -228,6 +228,7 @@ extern "C" {
#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__) #if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
DLLEXPORT char* ultoa(ulong, char*, int radix); DLLEXPORT char* ultoa(ulong, char*, int radix);
DLLEXPORT char* _i64toa(int64_t, char*, int radix);
#endif #endif
#if defined(__unix__) #if defined(__unix__)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment