[前][次][番号順一覧][スレッド一覧]

ruby-changes:66038

From: Benoit <ko1@a...>
Date: Tue, 4 May 2021 21:57:12 +0900 (JST)
Subject: [ruby-changes:66038] 9e2483ee0b (master): vm_dump.c: rename HAVE_BACKTRACE to USE_BACKTRACE

https://git.ruby-lang.org/ruby.git/commit/?id=9e2483ee0b

From 9e2483ee0b2cee0f8f8cc0b0fdfbe8abef462c00 Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
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) <xtkoba+ruby@g...>
---
 vm_dump.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/vm_dump.c b/vm_dump.c
index 109757a..26a2bf3 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -470,6 +470,7 @@ rb_vmdebug_thread_dump_state(VALUE self) https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L470
 #endif
 
 #if defined(HAVE_BACKTRACE)
+# define USE_BACKTRACE 1
 # ifdef HAVE_LIBUNWIND
 #  undef backtrace
 #  define backtrace unw_backtrace
@@ -572,14 +573,14 @@ darwin_sigtramp: https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L573
     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 <execinfo.h>
 #elif defined(_WIN32)
 # include <imagehlp.h>
@@ -752,7 +753,7 @@ dump_thread(void *arg) https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L753
 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) https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L1035
 
     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.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]