View | Details | Raw Unified | Return to bug 255910 | Differences between
and this patch

Collapse All | Expand All

(-)b/lang/ruby27/files/patch-include_ruby_ruby.h (+29 lines)
Added Link Here
1
--- include/ruby/ruby.h.orig	2021-04-05 12:39:38 UTC
2
+++ include/ruby/ruby.h
3
@@ -1828,12 +1828,14 @@ VALUE rb_sym2str(VALUE);
4
 VALUE rb_to_symbol(VALUE name);
5
 VALUE rb_check_symbol(volatile VALUE *namep);
6
 
7
-#define RUBY_CONST_ID_CACHE(result, str)		\
8
-    {							\
9
+#define RUBY_CONST_ID_CACHE_NB(result, str)		\
10
 	static ID rb_intern_id_cache;			\
11
 	if (!rb_intern_id_cache)			\
12
 	    rb_intern_id_cache = rb_intern2((str), (long)strlen(str)); \
13
-	result rb_intern_id_cache;			\
14
+	result rb_intern_id_cache;
15
+#define RUBY_CONST_ID_CACHE(result, str)		\
16
+    {							\
17
+	RUBY_CONST_ID_CACHE_NB(result, str)		\
18
     }
19
 #define RUBY_CONST_ID(var, str) \
20
     do RUBY_CONST_ID_CACHE((var) =, (str)) while (0)
21
@@ -1844,7 +1846,7 @@ VALUE rb_check_symbol(volatile VALUE *namep);
22
  * since gcc-2.7.2.3 at least. */
23
 #define rb_intern(str) \
24
     (__builtin_constant_p(str) ? \
25
-        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
26
+        __extension__ ({RUBY_CONST_ID_CACHE_NB((ID), (str))}) : \
27
         rb_intern(str))
28
 #define rb_intern_const(str) \
29
     (__builtin_constant_p(str) ? \

Return to bug 255910