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

ruby-changes:60444

From: Nobuyoshi <ko1@a...>
Date: Thu, 19 Mar 2020 13:32:50 +0900 (JST)
Subject: [ruby-changes:60444] b6833ff50d (master): Get rid of redefinition of `rb_execution_context_t`

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

From b6833ff50d2c7188e615839284263cf58cca48b7 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 19 Mar 2020 13:25:53 +0900
Subject: Get rid of redefinition of `rb_execution_context_t`

Regardless of the order to include "vm_core.h" and "builtin.h".

diff --git a/builtin.h b/builtin.h
index f4d485e..ce02720 100644
--- a/builtin.h
+++ b/builtin.h
@@ -22,8 +22,9 @@ struct rb_builtin_function { https://github.com/ruby/ruby/blob/trunk/builtin.h#L22
 
 void rb_load_with_builtin_functions(const char *feature_name, const struct rb_builtin_function *table);
 
-#ifndef VM_CORE_H_EC_DEFINED
+#ifndef rb_execution_context_t
 typedef struct rb_execution_context_struct rb_execution_context_t;
+#define rb_execution_context_t rb_execution_context_t
 #endif
 
 /* The following code is generated by the following Ruby script:
diff --git a/vm_core.h b/vm_core.h
index 754ce98..76757dc 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -827,7 +827,7 @@ typedef char rb_thread_id_string_t[sizeof(rb_nativethread_id_t) * 2 + 3]; https://github.com/ruby/ruby/blob/trunk/vm_core.h#L827
 
 typedef struct rb_fiber_struct rb_fiber_t;
 
-typedef struct rb_execution_context_struct {
+struct rb_execution_context_struct {
     /* execution information */
     VALUE *vm_stack;		/* must free, must mark */
     size_t vm_stack_size;       /* size in word (byte size / sizeof(VALUE)) */
@@ -876,7 +876,12 @@ typedef struct rb_execution_context_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L876
 	size_t stack_maxsize;
 	RUBY_ALIGNAS(SIZEOF_VALUE) jmp_buf regs;
     } machine;
-} rb_execution_context_t;
+};
+
+#ifndef rb_execution_context_t
+typedef struct rb_execution_context_struct rb_execution_context_t;
+#define rb_execution_context_t rb_execution_context_t
+#endif
 
 // for builtin.h
 #define VM_CORE_H_EC_DEFINED 1
-- 
cgit v0.10.2


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

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