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:
parent
388baa5380
commit
8088e486ee
@ -26,6 +26,14 @@
|
|||||||
# define rand(X) arc4random(X)
|
# define rand(X) arc4random(X)
|
||||||
#endif
|
#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;
|
FILE *fp_res;
|
||||||
int xmain(void);
|
int xmain(void);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user