libsodium 1.0.8
[tomato.git] / release / src / router / libsodium / test / quirks / quirks.h
blob00caf7c9272233bdc456d1bb006e47ff81bddc4a
2 #include <stdlib.h>
4 #ifdef __EMSCRIPTEN__
5 # define strcmp(s1, s2) xstrcmp(s1, s2)
7 int
8 strcmp(const char *s1, const char *s2) {
9 while (*s1 == *s2++) { if (*s1++ == 0) return 0; }
10 return *(unsigned char *) s1 - *(unsigned char *) --s2;
12 #endif
14 #ifdef _WIN32
15 static void
16 srandom(unsigned seed)
18 srand(seed);
21 static long
22 random(void)
24 return (long) rand();
26 #endif