mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-20 10:54:40 +01:00
Add libsodium source
This commit is contained in:
34
libsodium-1.0.18-RELEASE/test/quirks/quirks.h
Normal file
34
libsodium-1.0.18-RELEASE/test/quirks/quirks.h
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/* C++Builder defines a "random" macro */
|
||||
#undef random
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
# define strcmp(s1, s2) xstrcmp(s1, s2)
|
||||
|
||||
static 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
|
||||
Reference in New Issue
Block a user