libsodium/test/quirks/quirks.h

30 lines
445 B
C
Raw Normal View History

2015-01-23 05:02:13 -05:00
#include <stdlib.h>
2016-03-18 17:13:23 -04:00
/* C++Builder defines a "random" macro */
#undef random
2015-01-23 05:02:13 -05:00
#ifdef __EMSCRIPTEN__
# define strcmp(s1, s2) xstrcmp(s1, s2)
int
strcmp(const char *s1, const char *s2) {
while (*s1 == *s2++) { if (*s1++ == 0) return 0; }
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