mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
Allow building sources with mixed LF/CRLF line-endings.
Reported by mgood7123.
This commit is contained in:
parent
8a5e398c52
commit
126526ab93
@ -319,12 +319,18 @@ void emit_lib(BuildCtx *ctx)
|
||||
char *p;
|
||||
/* Simplistic pre-processor. Only handles top-level #if/#endif. */
|
||||
if (buf[0] == '#' && buf[1] == 'i' && buf[2] == 'f') {
|
||||
int ok = 1;
|
||||
if (!strcmp(buf, "#if LJ_52\n"))
|
||||
int ok = 1, len = strlen(buf);
|
||||
if (buf[len-1] == '\n') {
|
||||
buf[len-1] = 0;
|
||||
if (buf[len-2] == '\r') {
|
||||
buf[len-2] = 0;
|
||||
}
|
||||
}
|
||||
if (!strcmp(buf, "#if LJ_52"))
|
||||
ok = LJ_52;
|
||||
else if (!strcmp(buf, "#if LJ_HASJIT\n"))
|
||||
else if (!strcmp(buf, "#if LJ_HASJIT"))
|
||||
ok = LJ_HASJIT;
|
||||
else if (!strcmp(buf, "#if LJ_HASFFI\n"))
|
||||
else if (!strcmp(buf, "#if LJ_HASFFI"))
|
||||
ok = LJ_HASFFI;
|
||||
if (!ok) {
|
||||
int lvl = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user