Skip to content
Snippets Groups Projects
Commit 589c17bd authored by rswindell's avatar rswindell
Browse files

Created ultoa for GNU CC.

parent 1b3b5353
No related branches found
No related tags found
No related merge requests found
......@@ -89,20 +89,17 @@ extern "C" {
/* Compiler-specific */
/*********************/
#if defined(__GNUC__) /* GNU CC */
#warning "ultoa needs to be defined or replaced"
#define ultoa ltoa
#endif /* __GNUC__ */
#ifdef __GNUC__ /* GNU CC */
DLLEXPORT char* ultoa(ulong, char*, int radix);
#endif
#ifdef __BORLANDC__
#define sbbs_random(x) random(x)
#else
#else
DLLEXPORT int sbbs_random(int n);
#endif
#if (__BORLANDC__ > 0x0410)
#if __BORLANDC__ > 0x0410
#define _chmod(p,f,a) _rtl_chmod(p,f,a) /* _chmod obsolete in 4.x */
#endif
......
......@@ -107,6 +107,27 @@ int sbbs_random(int n)
}
#endif
/****************************************************************************/
/* There may be a native GNU C Library function to this... */
/****************************************************************************/
#ifdef __GNUC__
char* ultoa(ulong val, char* str, int radix)
{
switch(radix) {
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
/****************************************************************************/
/* Return free disk space in bytes (up to a maximum of 4GB) */
/****************************************************************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment