mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-30 15:41:12 +00:00
properly mask #message, #warning, #error by ftepp->output_on
This commit is contained in:
parent
0d1b40c9c1
commit
530dbd85b2
1 changed files with 17 additions and 3 deletions
14
ftepp.c
14
ftepp.c
|
@ -1285,11 +1285,17 @@ static bool ftepp_directive_warning(ftepp_t *ftepp) {
|
||||||
ftepp_next(ftepp);
|
ftepp_next(ftepp);
|
||||||
}
|
}
|
||||||
vec_push(message, '\0');
|
vec_push(message, '\0');
|
||||||
|
if (ftepp->output_on)
|
||||||
store = ftepp_warn(ftepp, WARN_CPP, message);
|
store = ftepp_warn(ftepp, WARN_CPP, message);
|
||||||
|
else
|
||||||
|
store = false;
|
||||||
vec_free(message);
|
vec_free(message);
|
||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ftepp->output_on)
|
||||||
|
return false;
|
||||||
|
|
||||||
unescape (ftepp_tokval(ftepp), ftepp_tokval(ftepp));
|
unescape (ftepp_tokval(ftepp), ftepp_tokval(ftepp));
|
||||||
return ftepp_warn(ftepp, WARN_CPP, "#warning %s", ftepp_tokval(ftepp));
|
return ftepp_warn(ftepp, WARN_CPP, "#warning %s", ftepp_tokval(ftepp));
|
||||||
}
|
}
|
||||||
|
@ -1309,11 +1315,15 @@ static void ftepp_directive_error(ftepp_t *ftepp) {
|
||||||
ftepp_next(ftepp);
|
ftepp_next(ftepp);
|
||||||
}
|
}
|
||||||
vec_push(message, '\0');
|
vec_push(message, '\0');
|
||||||
|
if (ftepp->output_on)
|
||||||
ftepp_error(ftepp, message);
|
ftepp_error(ftepp, message);
|
||||||
vec_free(message);
|
vec_free(message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ftepp->output_on)
|
||||||
|
return;
|
||||||
|
|
||||||
unescape (ftepp_tokval(ftepp), ftepp_tokval(ftepp));
|
unescape (ftepp_tokval(ftepp), ftepp_tokval(ftepp));
|
||||||
ftepp_error(ftepp, "#error %s", ftepp_tokval(ftepp));
|
ftepp_error(ftepp, "#error %s", ftepp_tokval(ftepp));
|
||||||
}
|
}
|
||||||
|
@ -1333,11 +1343,15 @@ static void ftepp_directive_message(ftepp_t *ftepp) {
|
||||||
ftepp_next(ftepp);
|
ftepp_next(ftepp);
|
||||||
}
|
}
|
||||||
vec_push(message, '\0');
|
vec_push(message, '\0');
|
||||||
|
if (ftepp->output_on)
|
||||||
con_cprintmsg(&ftepp->lex->tok.ctx, LVL_MSG, "message", message);
|
con_cprintmsg(&ftepp->lex->tok.ctx, LVL_MSG, "message", message);
|
||||||
vec_free(message);
|
vec_free(message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ftepp->output_on)
|
||||||
|
return;
|
||||||
|
|
||||||
unescape (ftepp_tokval(ftepp), ftepp_tokval(ftepp));
|
unescape (ftepp_tokval(ftepp), ftepp_tokval(ftepp));
|
||||||
con_cprintmsg(&ftepp->lex->tok.ctx, LVL_MSG, "message", ftepp_tokval(ftepp));
|
con_cprintmsg(&ftepp->lex->tok.ctx, LVL_MSG, "message", ftepp_tokval(ftepp));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue