Commit d684c433 authored by rswindell's avatar rswindell
Browse files

Added ultoa implementation (from src/sbbs3/wrappers.c).

parent 10c5b37e
...@@ -132,6 +132,31 @@ int DLLCALL xp_random(int n) ...@@ -132,6 +132,31 @@ int DLLCALL xp_random(int n)
return((int)(n*f)); return((int)(n*f));
} }
/****************************************************************************/
/* Return ASCII string representation of ulong */
/* There may be a native GNU C Library function to this... */
/****************************************************************************/
#if !defined _MSC_VER && !defined __BORLANDC__
char* DLLCALL ultoa(ulong val, char* str, int radix)
{
switch(radix) {
case 8:
sprintf(str,"%lo",val);
break;
case 10:
sprintf(str,"%lu",val);
break;
case 16:
sprintf(str,"%lx",val);
break;
default:
sprintf(str,"bad radix: %d",radix);
break;
}
return(str);
}
#endif
/****************************************************************************/ /****************************************************************************/
/* Write the version details of the current operating system into str */ /* Write the version details of the current operating system into str */
/****************************************************************************/ /****************************************************************************/
......
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