User supplied math constants take precedence

This commit is contained in:
Dale Weiler 2013-12-01 10:30:24 -05:00
parent 11ecc6cb0b
commit b20e2a9d34

View file

@ -539,9 +539,11 @@ static bool ftepp_define(ftepp_t *ftepp)
macro = ftepp_macro_find(ftepp, ftepp_tokval(ftepp)); macro = ftepp_macro_find(ftepp, ftepp_tokval(ftepp));
/* ignore creating a math macro if one is already present */ /* user defined ones take precedence */
if (macro && mathconstant) if (macro && mathconstant) {
break; ftepp_macro_delete(ftepp, ftepp_tokval(ftepp));
macro = NULL;
}
if (macro && ftepp->output_on) { if (macro && ftepp->output_on) {
if (ftepp_warn(ftepp, WARN_CPP, "redefining `%s`", ftepp_tokval(ftepp))) if (ftepp_warn(ftepp, WARN_CPP, "redefining `%s`", ftepp_tokval(ftepp)))