Browse Source

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.
mob
Arthur Williams 1 year ago
parent
commit
8482682061
  1. 4
      tccpp.c

4
tccpp.c

@ -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);

Loading…
Cancel
Save