From cdbb2dfe75c66ef0e54537da9664552dbec74133 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 23 Jan 2015 11:02:13 +0100 Subject: [PATCH] Import moved quirks.h --- test/quirks/quirks.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/quirks/quirks.h diff --git a/test/quirks/quirks.h b/test/quirks/quirks.h new file mode 100644 index 00000000..00caf7c9 --- /dev/null +++ b/test/quirks/quirks.h @@ -0,0 +1,26 @@ + +#include + +#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