From 9e2483ee0b2cee0f8f8cc0b0fdfbe8abef462c00 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 29 Apr 2021 13:15:19 +0200 Subject: vm_dump.c: rename HAVE_BACKTRACE to USE_BACKTRACE * HAVE_ macros should only be defined or undefined, not used for their value. * See [Feature #17752] Co-authored-by: xtkoba (Tee KOBAYASHI) --- vm_dump.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'vm_dump.c') diff --git a/vm_dump.c b/vm_dump.c index 109757a14e..26a2bf3ba4 100644 --- a/vm_dump.c +++ b/vm_dump.c @@ -470,6 +470,7 @@ rb_vmdebug_thread_dump_state(VALUE self) #endif #if defined(HAVE_BACKTRACE) +# define USE_BACKTRACE 1 # ifdef HAVE_LIBUNWIND # undef backtrace # define backtrace unw_backtrace @@ -572,14 +573,14 @@ darwin_sigtramp: return n; } # elif defined(BROKEN_BACKTRACE) -# undef HAVE_BACKTRACE -# define HAVE_BACKTRACE 0 +# undef USE_BACKTRACE +# define USE_BACKTRACE 0 # endif #else -# define HAVE_BACKTRACE 0 +# define USE_BACKTRACE 0 #endif -#if HAVE_BACKTRACE +#if USE_BACKTRACE # include #elif defined(_WIN32) # include @@ -752,7 +753,7 @@ dump_thread(void *arg) void rb_print_backtrace(void) { -#if HAVE_BACKTRACE +#if USE_BACKTRACE #define MAX_NATIVE_TRACE 1024 static void *trace[MAX_NATIVE_TRACE]; int n = (int)backtrace(trace, MAX_NATIVE_TRACE); @@ -1034,14 +1035,14 @@ rb_vm_bugreport(const void *ctx) rb_dump_machine_register(ctx); -#if HAVE_BACKTRACE || defined(_WIN32) +#if USE_BACKTRACE || defined(_WIN32) fprintf(stderr, "-- C level backtrace information " "-------------------------------------------\n"); rb_print_backtrace(); fprintf(stderr, "\n"); -#endif /* HAVE_BACKTRACE */ +#endif /* USE_BACKTRACE */ if (other_runtime_info || vm) { fprintf(stderr, "-- Other runtime information " -- cgit v1.2.1