strcmp() with optimization level > 1 is broken on Emscripten (!)

Trivial workaround that should eventually go to the quirks file
until this is fixed in Emscripten.
This commit is contained in:
Frank Denis 2015-01-22 19:06:21 +01:00
parent 388baa5380
commit 8088e486ee

View File

@ -26,6 +26,14 @@
# define rand(X) arc4random(X)
#endif
#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
FILE *fp_res;
int xmain(void);