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

ruby-changes:68937

From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:15:34 +0900 (JST)
Subject: [ruby-changes:68937] 7ee3636f61 (master): Remove unnamed enums because MSVC sux

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

From 7ee3636f61631429fe39d2d213efe1b711babbab Mon Sep 17 00:00:00 2001
From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...>
Date: Fri, 9 Apr 2021 10:14:06 -0400
Subject: Remove unnamed enums because MSVC sux

---
 yjit_core.h | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/yjit_core.h b/yjit_core.h
index 3830146f7e..ab849b9414 100644
--- a/yjit_core.h
+++ b/yjit_core.h
@@ -26,20 +26,20 @@ https://github.com/ruby/ruby/blob/trunk/yjit_core.h#L26
 // Default versioning context (no type information)
 #define DEFAULT_CTX ( (ctx_t){ 0 } )
 
+enum yjit_type_enum
+{
+    ETYPE_UNKNOWN = 0,
+    ETYPE_NIL,
+    ETYPE_FIXNUM,
+    ETYPE_ARRAY,
+    ETYPE_HASH,
+    ETYPE_SYMBOL,
+    ETYPE_STRING
+};
+
 // Represent the type of a value (local/stack/self) in YJIT
 typedef struct yjit_type_struct
 {
-    enum
-    {
-        ETYPE_UNKNOWN = 0,
-        ETYPE_NIL,
-        ETYPE_FIXNUM,
-        ETYPE_ARRAY,
-        ETYPE_HASH
-        //ETYPE_SYMBOL
-        //ETYPE_STRING
-    };
-
     // Value is definitely a heap object
     uint8_t is_heap : 1;
 
@@ -66,18 +66,18 @@ STATIC_ASSERT(val_type_size, sizeof(val_type_t) == 1); https://github.com/ruby/ruby/blob/trunk/yjit_core.h#L66
 #define TYPE_ARRAY ( (val_type_t){ .is_heap = 1, .type = ETYPE_ARRAY } )
 #define TYPE_HASH ( (val_type_t){ .is_heap = 1, .type = ETYPE_HASH } )
 
+enum yjit_temp_loc
+{
+    TEMP_STACK = 0,
+    TEMP_SELF,
+    TEMP_LOCAL,     // Local with index
+    //TEMP_CONST,   // Small constant (0, 1, 2, Qnil, Qfalse, Qtrue)
+};
+
 // Potential mapping of a value on the temporary stack to
 // self, a local variable or constant so that we can track its type
 typedef struct yjit_temp_mapping
 {
-    enum
-    {
-        TEMP_STACK = 0,
-        TEMP_SELF,
-        TEMP_LOCAL,     // Local with index
-        //TEMP_CONST,   // Small constant (0, 1, 2, Qnil, Qfalse, Qtrue)
-    };
-
     // Where/how is the value stored?
     uint8_t kind: 2;
 
-- 
cgit v1.2.1


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

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