diff --git a/ftepp.c b/ftepp.c index b8fc9f4..de5022a 100644 --- a/ftepp.c +++ b/ftepp.c @@ -1256,7 +1256,19 @@ bool ftepp_preprocess_string(const char *name, const char *str) bool ftepp_init() { 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() diff --git a/gmqcc.h b/gmqcc.h index 8171da3..dc3de39 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -804,6 +804,7 @@ bool ftepp_preprocess_string(const char *name, const char *str); void ftepp_finish (); const char *ftepp_get (); void ftepp_flush (); +void ftepp_add_define (const char *source, const char *name); /*===================================================================*/ /*======================= main.c commandline ========================*/