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

ruby-changes:61188

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Mon, 11 May 2020 09:24:34 +0900 (JST)
Subject: [ruby-changes:61188] 97672f669a (master): sed -i s/RUBY3/RBIMPL/g

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

From 97672f669af53c41b094772559030195787406be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Mon, 4 May 2020 15:52:56 +0900
Subject: sed -i s/RUBY3/RBIMPL/g

Devs do not love "3".  The only exception is RUBY3_KEYWORDS in parse.y,
which seems unrelated to our interests.

diff --git a/gc.c b/gc.c
index 60cdb1d..3b2a2d8 100644
--- a/gc.c
+++ b/gc.c
@@ -9603,7 +9603,7 @@ ruby_memerror_body(void *dummy) https://github.com/ruby/ruby/blob/trunk/gc.c#L9603
 }
 
 NORETURN(static void ruby_memerror(void));
-RUBY3_ATTR_MAYBE_UNUSED()
+RBIMPL_ATTR_MAYBE_UNUSED()
 static void
 ruby_memerror(void)
 {
diff --git a/include/ruby/assert.h b/include/ruby/assert.h
index 01ef6a2..3c578c4 100644
--- a/include/ruby/assert.h
+++ b/include/ruby/assert.h
@@ -8,7 +8,7 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/assert.h#L8
  *             Permission  is hereby  granted,  to  either redistribute  and/or
  *             modify this file, provided that  the conditions mentioned in the
  *             file COPYING are met.  Consult the file for details.
- * @warning    Symbols   prefixed   with   either  `RUBY3`   or   `ruby3`   are
+ * @warning    Symbols   prefixed  with   either  `RBIMPL`   or   `ruby3`   are
  *             implementation details.   Don't take  them as canon.  They could
  *             rapidly appear then vanish.  The name (path) of this header file
  *             is also an  implementation detail.  Do not expect  it to persist
@@ -48,25 +48,25 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/assert.h#L48
 # define RUBY_NDEBUG 1
 #endif
 
-#define RUBY3_ASSERT_NOTHING RUBY3_CAST((void)0)
+#define RBIMPL_ASSERT_NOTHING RBIMPL_CAST((void)0)
 
-RUBY3_SYMBOL_EXPORT_BEGIN()
-RUBY3_ATTR_NORETURN()
-RUBY3_ATTR_COLD()
+RBIMPL_SYMBOL_EXPORT_BEGIN()
+RBIMPL_ATTR_NORETURN()
+RBIMPL_ATTR_COLD()
 void rb_assert_failure(const char *file, int line, const char *name, const char *expr);
-RUBY3_SYMBOL_EXPORT_END()
+RBIMPL_SYMBOL_EXPORT_END()
 
 #ifdef RUBY_FUNCTION_NAME_STRING
-# define RUBY3_ASSERT_FUNC RUBY_FUNCTION_NAME_STRING
+# define RBIMPL_ASSERT_FUNC RUBY_FUNCTION_NAME_STRING
 #else
-# define RUBY3_ASSERT_FUNC RUBY3_CAST((const char *)0)
+# define RBIMPL_ASSERT_FUNC RBIMPL_CAST((const char *)0)
 #endif
 
 #define RUBY_ASSERT_FAIL(expr) \
-    rb_assert_failure(__FILE__, __LINE__, RUBY3_ASSERT_FUNC, #expr)
+    rb_assert_failure(__FILE__, __LINE__, RBIMPL_ASSERT_FUNC, #expr)
 
 #define RUBY_ASSERT_MESG(expr, mesg) \
-    (RB_LIKELY(expr) ? RUBY3_ASSERT_NOTHING : RUBY_ASSERT_FAIL(mesg))
+    (RB_LIKELY(expr) ? RBIMPL_ASSERT_NOTHING : RUBY_ASSERT_FAIL(mesg))
 
 #if RUBY_DEBUG
 # define RUBY_ASSERT_MESG_WHEN(cond, expr, mesg) RUBY_ASSERT_MESG((expr), mesg)
@@ -78,7 +78,7 @@ RUBY3_SYMBOL_EXPORT_END() https://github.com/ruby/ruby/blob/trunk/include/ruby/assert.h#L78
         __builtin_constant_p(cond), \
         __builtin_choose_expr(cond, \
             RUBY_ASSERT_MESG(expr, mesg), \
-            RUBY3_ASSERT_NOTHING), \
+            RBIMPL_ASSERT_NOTHING), \
         RUBY_ASSERT_MESG(!(cond) || (expr), mesg))
 #endif /* RUBY_DEBUG */
 
@@ -87,13 +87,13 @@ RUBY3_SYMBOL_EXPORT_END() https://github.com/ruby/ruby/blob/trunk/include/ruby/assert.h#L87
 #define RUBY_ASSERT_ALWAYS(expr) RUBY_ASSERT_MESG_WHEN(TRUE, expr, #expr)
 
 #if ! RUBY_NDEBUG
-# define RUBY3_ASSERT_OR_ASSUME(_) RUBY_ASSERT(_)
-#elif defined(RUBY3_HAVE___ASSUME)
-# define RUBY3_ASSERT_OR_ASSUME(_) RUBY3_ASSUME(_)
-#elif RUBY3_HAS_BUILTIN(__builtin_assume)
-# define RUBY3_ASSERT_OR_ASSUME(_) RUBY3_ASSUME(_)
+# define RBIMPL_ASSERT_OR_ASSUME(_) RUBY_ASSERT(_)
+#elif defined(RBIMPL_HAVE___ASSUME)
+# define RBIMPL_ASSERT_OR_ASSUME(_) RBIMPL_ASSUME(_)
+#elif RBIMPL_HAS_BUILTIN(__builtin_assume)
+# define RBIMPL_ASSERT_OR_ASSUME(_) RBIMPL_ASSUME(_)
 #else
-# define RUBY3_ASSERT_OR_ASSUME(_) /* void */
+# define RBIMPL_ASSERT_OR_ASSUME(_) /* void */
 #endif
 
 #endif /* RUBY_ASSERT_H */
diff --git a/include/ruby/backward/2/assume.h b/include/ruby/backward/2/assume.h
index 5444889..d6fbcd7 100644
--- a/include/ruby/backward/2/assume.h
+++ b/include/ruby/backward/2/assume.h
@@ -7,7 +7,7 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/2/assume.h#L7
  *             Permission  is hereby  granted,  to  either redistribute  and/or
  *             modify this file, provided that  the conditions mentioned in the
  *             file COPYING are met.  Consult the file for details.
- * @warning    Symbols   prefixed   with   either  `RUBY3`   or   `ruby3`   are
+ * @warning    Symbols   prefixed  with   either  `RBIMPL`   or   `ruby3`   are
  *             implementation details.   Don't take  them as canon.  They could
  *             rapidly appear then vanish.  The name (path) of this header file
  *             is also an  implementation detail.  Do not expect  it to persist
@@ -26,12 +26,12 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/2/assume.h#L26
 
 #undef  ASSUME             /* Kill config.h definition */
 #undef  UNREACHABLE        /* Kill config.h definition */
-#define ASSUME             RUBY3_ASSUME
-#define UNREACHABLE        RUBY3_UNREACHABLE()
-#define UNREACHABLE_RETURN RUBY3_UNREACHABLE_RETURN
+#define ASSUME             RBIMPL_ASSUME
+#define UNREACHABLE        RBIMPL_UNREACHABLE()
+#define UNREACHABLE_RETURN RBIMPL_UNREACHABLE_RETURN
 
 /* likely */
-#if RUBY3_HAS_BUILTIN(__builtin_expect)
+#if RBIMPL_HAS_BUILTIN(__builtin_expect)
 # define RB_LIKELY(x)   (__builtin_expect(!!(x), 1))
 # define RB_UNLIKELY(x) (__builtin_expect(!!(x), 0))
 
diff --git a/include/ruby/backward/2/attributes.h b/include/ruby/backward/2/attributes.h
index 8bf72ba..4fd0b99 100644
--- a/include/ruby/backward/2/attributes.h
+++ b/include/ruby/backward/2/attributes.h
@@ -7,7 +7,7 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/2/attributes.h#L7
  *             Permission  is hereby  granted,  to  either redistribute  and/or
  *             modify this file, provided that  the conditions mentioned in the
  *             file COPYING are met.  Consult the file for details.
- * @warning    Symbols   prefixed   with   either  `RUBY3`   or   `ruby3`   are
+ * @warning    Symbols   prefixed  with   either  `RBIMPL`   or   `ruby3`   are
  *             implementation details.   Don't take  them as canon.  They could
  *             rapidly appear then vanish.  The name (path) of this header file
  *             is also an  implementation detail.  Do not expect  it to persist
@@ -48,42 +48,42 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/2/attributes.h#L48
 
 /* function attributes */
 #undef CONSTFUNC
-#define CONSTFUNC(x) RUBY3_ATTR_CONST() x
+#define CONSTFUNC(x) RBIMPL_ATTR_CONST() x
 
 #undef PUREFUNC
-#define PUREFUNC(x) RUBY3_ATTR_PURE() x
+#define PUREFUNC(x) RBIMPL_ATTR_PURE() x
 
 #undef DEPRECATED
-#define DEPRECATED(x) RUBY3_ATTR_DEPRECATED(("")) x
+#define DEPRECATED(x) RBIMPL_ATTR_DEPRECATED(("")) x
 
 #undef DEPRECATED_BY
-#define DEPRECATED_BY(n,x) RUBY3_ATTR_DEPRECATED(("by: " # n)) x
+#define DEPRECATED_BY(n,x) RBIMPL_ATTR_DEPRECATED(("by: " # n)) x
 
 #undef DEPRECATED_TYPE
-#define DEPRECATED_TYPE(mseg, decl) decl RUBY3_ATTR_DEPRECATED(mseg)
+#define DEPRECATED_TYPE(mseg, decl) decl RBIMPL_ATTR_DEPRECATED(mseg)
 
 #undef RUBY_CXX_DEPRECATED
-#define RUBY_CXX_DEPRECATED(mseg) RUBY3_ATTR_DEPRECATED((mseg))
+#define RUBY_CXX_DEPRECATED(mseg) RBIMPL_ATTR_DEPRECATED((mseg))
 
 #undef NOINLINE
-#define NOINLINE(x) RUBY3_ATTR_NOINLINE() x
+#define NOINLINE(x) RBIMPL_ATTR_NOINLINE() x
 
 #ifndef MJIT_HEADER
 # undef ALWAYS_INLINE
-# define ALWAYS_INLINE(x) RUBY3_ATTR_FORCEINLINE() x
+# define ALWAYS_INLINE(x) RBIMPL_ATTR_FORCEINLINE() x
 #endif
 
 #undef ERRORFUNC
-#define ERRORFUNC(mesg, x) RUBY3_ATTR_ERROR(mesg) x
-#if RUBY3_HAS_ATTRIBUTE(error)
+#define ERRORFUNC(mesg, x) RBIMPL_ATTR_ERROR(mesg) x
+#if RBIMPL_HAS_ATTRIBUTE(error)
 # define HAVE_ATTRIBUTE_ERRORFUNC 1
 #else
 # define HAVE_ATTRIBUTE_ERRORFUNC 0
 #endif
 
 #undef WARNINGFUNC
-#define WARNINGFUNC(mesg, x) RUBY3_ATTR_WARNING(mesg) x
-#if RUBY3_HAS_ATTRIBUTE(warning)
+#define WARNINGFUNC(mesg, x) RBIMPL_ATTR_WARNING(mesg) x
+#if RBIMPL_HAS_ATTRIBUTE(warning)
 # define HAVE_ATTRIBUTE_WARNINGFUNC 1
 #else
 # define HAVE_ATTRIBUTE_WARNINGFUNC 0
@@ -94,20 +94,20 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/2/attributes.h#L94
   RUBY_FUNC_ATTRIBUTE not used because MSVC does not like nested func macros
  */
 #undef COLDFUNC
-#define COLDFUNC RUBY3_ATTR_COLD()
+#define COLDFUNC RBIMPL_ATTR_COLD()
 
 #define PRINTF_ARGS(decl, string_index, first_to_check) \
-    RUBY3_ATTR_FORMAT(RUBY3_PRINTF_FORMAT, (string_index), (first_to_check)) \
+    RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, (string_index), (first_to_check)) \
     decl
 
 #undef RUBY_ATTR_ALLOC_SIZE
-#define RUBY_ATTR_ALLOC_SIZE RUBY3_ATTR_ALLOC_SIZE
+#define RUBY_ATTR_ALLOC_SIZE RBIMPL_ATTR_ALLOC_SIZE
 
 #undef RUBY_ATTR_MALLOC
-#define RUBY_ATTR_MALLOC RUBY3_ATTR_RESTRICT()
+#define RUBY_ATTR_MALLOC RBIMPL_ATTR_RESTRICT()
 
 #undef RUBY_ATTR_RETURNS_NONNULL
-#define RUBY_ATTR_RETURNS_NONNULL RUBY3_ATTR_RETURNS_NONNULL()
+#define RUBY_ATTR_RETURNS_NONNULL RBIMPL_ATTR_RETURNS_NONNULL()
 
 #ifndef FUNC_MINIMIZED
 #define FUNC_MINIMIZED(x) x
@@ -133,10 +133,10 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/2/attributes.h#L133
 #endif
 
 #undef RUBY_FUNC_NONNULL
-#define RUBY_FUNC_NONNULL(n, x) RUBY3_ATTR_NONNULL(n) x
+#define RUBY_FUNC_NONNULL(n, x) RBIMPL_ATTR_NONNULL(n) x
 
 #undef  NORETURN
-#define NORETURN(x) RUBY3_ATTR_NORETURN() x
+#define NORETURN(x) RBIMPL_ATTR_NORETURN() x
 #define NORETURN_STYLE_NEW
 
 #ifndef PACKED_STRUCT
@@ -152,6 +152,6 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/backward/2/attributes.h#L152
 #endif
 
 #undef RB_UNUSED_VAR
-#define RB_UNUSED_VAR(x) x RUBY3_ATTR_MAYBE_UNUSED()
+#define RB_UNUSED_VAR(x) x RBIMPL_ATTR_MAYBE_UNUSED()
 
 #endif  (... truncated)

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

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