Define __TCC_BACKTRACE_ENABLED__ if backtrace is enabled

If the `-btN` was specified, then the __TCC_BACKTRACE_ENABLED__
macro will be defined. This provides a way for user code
to tell if tcc_backtrace is defined or not.
This commit is contained in:
Arthur Williams 2022-07-23 15:03:21 -07:00
parent af1abf1f45
commit 8482682061

View File

@ -3756,6 +3756,10 @@ static void tcc_predefs(TCCState *s1, CString *cs, int is_asm)
#ifdef CONFIG_TCC_BCHECK
if (s1->do_bounds_check)
putdef(cs, "__BOUNDS_CHECKING_ON");
#endif
#ifdef CONFIG_TCC_BACKTRACE
if (s1->do_backtrace)
putdef(cs, "__TCC_BACKTRACE_ENABLED__");
#endif
cstr_printf(cs, "#define __SIZEOF_POINTER__ %d\n", PTR_SIZE);
cstr_printf(cs, "#define __SIZEOF_LONG__ %d\n", LONG_SIZE);