[bot] Implement SignalHandler, GetTickCount, strlwr

This commit is contained in:
RD42 2023-12-18 23:26:11 +08:00
parent 04dece8c8b
commit 37bc99154a
2 changed files with 39 additions and 0 deletions

View File

@ -140,3 +140,36 @@ void SetStringFromCommandLine(char* szCmdLine, char* szString)
}
//----------------------------------------------------
#ifdef LINUX
void SignalHandler(int sig)
{
// nothing
}
//----------------------------------------------------
#include <time.h>
long GetTickCount()
{
tms tm;
return (times(&tm) * 10);
}
// strlwr is not included with the GNU C lib it seems.
char* strlwr(char* str)
{
for (size_t i=0; i<strlen(str); i++)
{
if ((str[i] >= 'A') && (str[i] <= 'Z'))
{
str[i] -= 32;
}
}
return str;
}
#endif
//----------------------------------------------------

View File

@ -33,3 +33,9 @@ typedef struct _GAME_SETTINGS {
#include "net/netgame.h"
void logprintf(char* format, ...);
#ifdef LINUX
void SignalHandler(int sig);
long GetTickCount();
char* strlwr(char* str);
#endif