mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-12-18 08:22:13 +00:00
Let's #define GMQCC by default
This commit is contained in:
parent
f6b7ddf72b
commit
4a3921fcb9
2 changed files with 14 additions and 1 deletions
14
ftepp.c
14
ftepp.c
|
@ -1256,7 +1256,19 @@ bool ftepp_preprocess_string(const char *name, const char *str)
|
||||||
bool ftepp_init()
|
bool ftepp_init()
|
||||||
{
|
{
|
||||||
ftepp = ftepp_new();
|
ftepp = ftepp_new();
|
||||||
return !!ftepp;
|
if (!ftepp)
|
||||||
|
return false;
|
||||||
|
ftepp_add_define(NULL, "GMQCC");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ftepp_add_define(const char *source, const char *name)
|
||||||
|
{
|
||||||
|
ppmacro *macro;
|
||||||
|
lex_ctx ctx = { "__builtin__", 0 };
|
||||||
|
ctx.file = source;
|
||||||
|
macro = ppmacro_new(ctx, name);
|
||||||
|
vec_push(ftepp->macros, macro);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *ftepp_get()
|
const char *ftepp_get()
|
||||||
|
|
1
gmqcc.h
1
gmqcc.h
|
@ -804,6 +804,7 @@ bool ftepp_preprocess_string(const char *name, const char *str);
|
||||||
void ftepp_finish ();
|
void ftepp_finish ();
|
||||||
const char *ftepp_get ();
|
const char *ftepp_get ();
|
||||||
void ftepp_flush ();
|
void ftepp_flush ();
|
||||||
|
void ftepp_add_define (const char *source, const char *name);
|
||||||
|
|
||||||
/*===================================================================*/
|
/*===================================================================*/
|
||||||
/*======================= main.c commandline ========================*/
|
/*======================= main.c commandline ========================*/
|
||||||
|
|
Loading…
Reference in a new issue