2015-01-23 03:02:13 -07:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2016-03-18 14:13:23 -07:00
|
|
|
/* C++Builder defines a "random" macro */
|
2016-03-18 09:56:37 -07:00
|
|
|
#undef random
|
|
|
|
|
2015-01-23 03:02:13 -07:00
|
|
|
#ifdef __EMSCRIPTEN__
|
|
|
|
# define strcmp(s1, s2) xstrcmp(s1, s2)
|
|
|
|
|
2016-04-29 11:34:24 -07:00
|
|
|
static int
|
2017-02-23 03:13:43 -07:00
|
|
|
strcmp(const char *s1, const char *s2)
|
|
|
|
{
|
2016-04-29 11:34:24 -07:00
|
|
|
while (*s1 == *s2++) {
|
|
|
|
if (*s1++ == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2015-01-23 03:02:13 -07:00
|
|
|
return *(unsigned char *) s1 - *(unsigned char *) --s2;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
static void
|
|
|
|
srandom(unsigned seed)
|
|
|
|
{
|
|
|
|
srand(seed);
|
|
|
|
}
|
|
|
|
|
|
|
|
static long
|
|
|
|
random(void)
|
|
|
|
{
|
|
|
|
return (long) rand();
|
|
|
|
}
|
|
|
|
#endif
|