mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-23 20:15:19 -07:00
Import moved quirks.h
This commit is contained in:
parent
9e538624f4
commit
cdbb2dfe75
26
test/quirks/quirks.h
Normal file
26
test/quirks/quirks.h
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#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
|
Loading…
Reference in New Issue
Block a user