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

ruby-changes:68837

From: Alan <ko1@a...>
Date: Thu, 21 Oct 2021 08:14:11 +0900 (JST)
Subject: [ruby-changes:68837] cee597bd01 (master): Include ruby/ruby.h before vm_core.h

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

From cee597bd01ef999d5b8b86b639260282aa594467 Mon Sep 17 00:00:00 2001
From: Alan Wu <XrXr@u...>
Date: Fri, 12 Mar 2021 12:25:58 -0500
Subject: Include ruby/ruby.h before vm_core.h

This is how vm.c does it, and if we don't follow it in yjit
compilation units, rb_vm_t would have a conflicting size.
---
 yjit_core.c  |  8 ++------
 yjit_iface.c |  4 ++--
 yjit_iface.h | 13 +------------
 3 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/yjit_core.c b/yjit_core.c
index 4640853d57..ecca311a46 100644
--- a/yjit_core.c
+++ b/yjit_core.c
@@ -1,14 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/yjit_core.c#L1
-#include "vm_core.h"
-#include "vm_callinfo.h"
-#include "builtin.h"
-#include "insns.inc"
-#include "insns_info.inc"
-#include "vm_sync.h"
 #include "yjit_asm.h"
 #include "yjit_utils.h"
 #include "yjit_iface.h"
 #include "yjit_core.h"
 #include "yjit_codegen.h"
+#include "vm_sync.h"
+#include "builtin.h"
 
 // Maximum number of versions per block
 #define MAX_VERSIONS 4
diff --git a/yjit_iface.c b/yjit_iface.c
index c29b4d8e81..9d8087e4ab 100644
--- a/yjit_iface.c
+++ b/yjit_iface.c
@@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/yjit_iface.c#L1
-#include <assert.h>
+#include "ruby/ruby.h"
+#include "vm_core.h"
 #include "insns.inc"
 #include "internal.h"
-#include "vm_core.h"
 #include "vm_sync.h"
 #include "vm_callinfo.h"
 #include "builtin.h"
diff --git a/yjit_iface.h b/yjit_iface.h
index d525337d24..88e65322eb 100644
--- a/yjit_iface.h
+++ b/yjit_iface.h
@@ -6,21 +6,10 @@ https://github.com/ruby/ruby/blob/trunk/yjit_iface.h#L6
 #ifndef YJIT_IFACE_H
 #define YJIT_IFACE_H 1
 
-#include "stddef.h"
-#include "stdint.h"
-#include "stdbool.h"
-#include "internal.h"
-#include "ruby/internal/attr/nodiscard.h"
+#include "ruby/ruby.h"
 #include "vm_core.h"
-#include "vm_callinfo.h"
-#include "builtin.h"
 #include "yjit_core.h"
 
-#ifndef rb_callcache
-struct rb_callcache;
-#define rb_callcache rb_callcache
-#endif
-
 #define YJIT_DECLARE_COUNTERS(...) struct rb_yjit_runtime_counters { \
     int64_t __VA_ARGS__; \
 }; \
-- 
cgit v1.2.1


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

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