Skip to content

Commit

Permalink
sed -i s/RUBY3/RBIMPL/g
Browse files Browse the repository at this point in the history
Devs do not love "3".  The only exception is RUBY3_KEYWORDS in parse.y,
which seems unrelated to our interests.
  • Loading branch information
shyouhei committed May 11, 2020
1 parent d7f4d73 commit 97672f6
Show file tree
Hide file tree
Showing 175 changed files with 2,232 additions and 2,232 deletions.
2 changes: 1 addition & 1 deletion gc.c
Expand Up @@ -9603,7 +9603,7 @@ ruby_memerror_body(void *dummy)
}

NORETURN(static void ruby_memerror(void));
RUBY3_ATTR_MAYBE_UNUSED()
RBIMPL_ATTR_MAYBE_UNUSED()
static void
ruby_memerror(void)
{
Expand Down
34 changes: 17 additions & 17 deletions include/ruby/assert.h
Expand Up @@ -8,7 +8,7 @@
* 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
Expand Down Expand Up @@ -48,25 +48,25 @@
# 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)
Expand All @@ -78,7 +78,7 @@ RUBY3_SYMBOL_EXPORT_END()
__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 */

Expand All @@ -87,13 +87,13 @@ RUBY3_SYMBOL_EXPORT_END()
#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 */
10 changes: 5 additions & 5 deletions include/ruby/backward/2/assume.h
Expand Up @@ -7,7 +7,7 @@
* 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
Expand All @@ -26,12 +26,12 @@

#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))

Expand Down
42 changes: 21 additions & 21 deletions include/ruby/backward/2/attributes.h
Expand Up @@ -7,7 +7,7 @@
* 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
Expand Down Expand Up @@ -48,42 +48,42 @@

/* 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
Expand All @@ -94,20 +94,20 @@
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
Expand All @@ -133,10 +133,10 @@
#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
Expand All @@ -152,6 +152,6 @@
#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 /* RUBY_BACKWARD2_ATTRIBUTES_H */
2 changes: 1 addition & 1 deletion include/ruby/backward/2/bool.h
Expand Up @@ -7,7 +7,7 @@
* 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
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/backward/2/extern.h
Expand Up @@ -7,7 +7,7 @@
* 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
Expand Down
14 changes: 7 additions & 7 deletions include/ruby/backward/2/gcc_version_since.h
Expand Up @@ -7,7 +7,7 @@
* 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
Expand All @@ -23,16 +23,16 @@
#include "ruby/impl/compiler_since.h"

#ifndef GCC_VERSION_SINCE
#define GCC_VERSION_SINCE(x, y, z) RUBY3_COMPILER_SINCE(GCC, (x), (y), (z))
#define GCC_VERSION_SINCE(x, y, z) RBIMPL_COMPILER_SINCE(GCC, (x), (y), (z))
#endif

#ifndef GCC_VERSION_BEFORE
#define GCC_VERSION_BEFORE(x, y, z) \
(RUBY3_COMPILER_BEFORE(GCC, (x), (y), (z)) || \
(RUBY3_COMPILER_IS(GCC) && \
((RUBY3_COMPILER_VERSION_MAJOR == (x)) && \
((RUBY3_COMPILER_VERSION_MINOR == (y)) && \
(RUBY3_COMPILER_VERSION_PATCH == (z))))))
(RBIMPL_COMPILER_BEFORE(GCC, (x), (y), (z)) || \
(RBIMPL_COMPILER_IS(GCC) && \
((RBIMPL_COMPILER_VERSION_MAJOR == (x)) && \
((RBIMPL_COMPILER_VERSION_MINOR == (y)) && \
(RBIMPL_COMPILER_VERSION_PATCH == (z))))))
#endif

#endif /* RUBY_BACKWARD2_GCC_VERSION_SINCE_H */
2 changes: 1 addition & 1 deletion include/ruby/backward/2/inttypes.h
Expand Up @@ -7,7 +7,7 @@
* 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
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/backward/2/limits.h
Expand Up @@ -7,7 +7,7 @@
* 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
Expand Down
20 changes: 10 additions & 10 deletions include/ruby/backward/2/long_long.h
Expand Up @@ -7,7 +7,7 @@
* 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
Expand All @@ -29,21 +29,21 @@
#include "ruby/impl/has/warning.h"
#include "ruby/impl/warning_push.h"

#if RUBY3_HAS_WARNING("-Wc++11-long-long")
#if RBIMPL_HAS_WARNING("-Wc++11-long-long")
# define HAVE_TRUE_LONG_LONG 1
# define LONG_LONG \
RUBY3_WARNING_PUSH() \
RUBY3_WARNING_IGNORED(-Wc++11-long-long) \
RBIMPL_WARNING_PUSH() \
RBIMPL_WARNING_IGNORED(-Wc++11-long-long) \
long long \
RUBY3_WARNING_POP()
RBIMPL_WARNING_POP()

#elif RUBY3_HAS_WARNING("-Wlong-long")
#elif RBIMPL_HAS_WARNING("-Wlong-long")
# define HAVE_TRUE_LONG_LONG 1
# define LONG_LONG \
RUBY3_WARNING_PUSH() \
RUBY3_WARNING_IGNORED(-Wlong-long) \
RBIMPL_WARNING_PUSH() \
RBIMPL_WARNING_IGNORED(-Wlong-long) \
long long \
RUBY3_WARNING_POP()
RBIMPL_WARNING_POP()

#elif defined(HAVE_LONG_LONG)
# define HAVE_TRUE_LONG_LONG 1
Expand All @@ -62,4 +62,4 @@
# error Thank you!
#endif

#endif /* RUBY3_BACKWARD2_LONG_LONG_H */
#endif /* RBIMPL_BACKWARD2_LONG_LONG_H */
2 changes: 1 addition & 1 deletion include/ruby/backward/2/r_cast.h
Expand Up @@ -7,7 +7,7 @@
* 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
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/backward/2/rmodule.h
Expand Up @@ -7,7 +7,7 @@
* 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
Expand Down
6 changes: 3 additions & 3 deletions include/ruby/backward/2/stdalign.h
Expand Up @@ -7,7 +7,7 @@
* 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
Expand All @@ -24,7 +24,7 @@

#undef RUBY_ALIGNAS
#undef RUBY_ALIGNOF
#define RUBY_ALIGNAS RUBY3_ALIGNAS
#define RUBY_ALIGNOF RUBY3_ALIGNOF
#define RUBY_ALIGNAS RBIMPL_ALIGNAS
#define RUBY_ALIGNOF RBIMPL_ALIGNOF

#endif /* RUBY_BACKWARD2_STDALIGN_H */
2 changes: 1 addition & 1 deletion include/ruby/backward/2/stdarg.h
Expand Up @@ -7,7 +7,7 @@
* 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
Expand Down
4 changes: 2 additions & 2 deletions include/ruby/debug.h
Expand Up @@ -14,7 +14,7 @@
#include "ruby/impl/event.h"
#include "ruby/impl/value.h"

RUBY3_SYMBOL_EXPORT_BEGIN()
RBIMPL_SYMBOL_EXPORT_BEGIN()

/* Note: This file contains experimental APIs. */
/* APIs can be replaced at Ruby 2.0.1 or later */
Expand Down Expand Up @@ -98,6 +98,6 @@ typedef enum {
void rb_add_event_hook2(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
void rb_thread_add_event_hook2(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);

RUBY3_SYMBOL_EXPORT_END()
RBIMPL_SYMBOL_EXPORT_END()

#endif /* RUBY_DEBUG_H */

0 comments on commit 97672f6

Please sign in to comment.