zscan 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/pack/pack-27.c +1 -0
- data/ext/pack/pack.c +1 -0
- data/ext/pack/ruby/backward/2/assume.h +43 -0
- data/ext/pack/ruby/backward/2/attributes.h +157 -0
- data/ext/pack/ruby/backward/2/bool.h +37 -0
- data/ext/pack/ruby/backward/2/extern.h +46 -0
- data/ext/pack/ruby/backward/2/gcc_version_since.h +38 -0
- data/ext/pack/ruby/backward/2/inttypes.h +132 -0
- data/ext/pack/ruby/backward/2/limits.h +100 -0
- data/ext/pack/ruby/backward/2/long_long.h +65 -0
- data/ext/pack/ruby/backward/2/r_cast.h +27 -0
- data/ext/pack/ruby/backward/2/rmodule.h +31 -0
- data/ext/pack/ruby/backward/2/stdalign.h +30 -0
- data/ext/pack/ruby/backward/2/stdarg.h +47 -0
- data/ext/pack/ruby/backward/classext.h +25 -0
- data/ext/pack/ruby/backward/rubyio.h +18 -0
- data/ext/pack/ruby/backward/rubysig.h +26 -0
- data/ext/pack/ruby/backward/st.h +18 -0
- data/ext/pack/ruby/backward/util.h +18 -0
- data/ext/pack/ruby/internal/anyargs.h +375 -0
- data/ext/pack/ruby/internal/arithmetic.h +38 -0
- data/ext/pack/ruby/internal/arithmetic/char.h +58 -0
- data/ext/pack/ruby/internal/arithmetic/double.h +39 -0
- data/ext/pack/ruby/internal/arithmetic/fixnum.h +44 -0
- data/ext/pack/ruby/internal/arithmetic/gid_t.h +34 -0
- data/ext/pack/ruby/internal/arithmetic/int.h +163 -0
- data/ext/pack/ruby/internal/arithmetic/intptr_t.h +42 -0
- data/ext/pack/ruby/internal/arithmetic/long.h +244 -0
- data/ext/pack/ruby/internal/arithmetic/long_long.h +53 -0
- data/ext/pack/ruby/internal/arithmetic/mode_t.h +34 -0
- data/ext/pack/ruby/internal/arithmetic/off_t.h +49 -0
- data/ext/pack/ruby/internal/arithmetic/pid_t.h +34 -0
- data/ext/pack/ruby/internal/arithmetic/short.h +54 -0
- data/ext/pack/ruby/internal/arithmetic/size_t.h +51 -0
- data/ext/pack/ruby/internal/arithmetic/st_data_t.h +59 -0
- data/ext/pack/ruby/internal/arithmetic/uid_t.h +34 -0
- data/ext/pack/ruby/internal/assume.h +90 -0
- data/ext/pack/ruby/internal/attr/alloc_size.h +32 -0
- data/ext/pack/ruby/internal/attr/artificial.h +46 -0
- data/ext/pack/ruby/internal/attr/cold.h +37 -0
- data/ext/pack/ruby/internal/attr/const.h +46 -0
- data/ext/pack/ruby/internal/attr/constexpr.h +85 -0
- data/ext/pack/ruby/internal/attr/deprecated.h +59 -0
- data/ext/pack/ruby/internal/attr/diagnose_if.h +42 -0
- data/ext/pack/ruby/internal/attr/enum_extensibility.h +32 -0
- data/ext/pack/ruby/internal/attr/error.h +32 -0
- data/ext/pack/ruby/internal/attr/flag_enum.h +33 -0
- data/ext/pack/ruby/internal/attr/forceinline.h +40 -0
- data/ext/pack/ruby/internal/attr/format.h +38 -0
- data/ext/pack/ruby/internal/attr/maybe_unused.h +38 -0
- data/ext/pack/ruby/internal/attr/noalias.h +58 -0
- data/ext/pack/ruby/internal/attr/nodiscard.h +45 -0
- data/ext/pack/ruby/internal/attr/noexcept.h +91 -0
- data/ext/pack/ruby/internal/attr/noinline.h +35 -0
- data/ext/pack/ruby/internal/attr/nonnull.h +32 -0
- data/ext/pack/ruby/internal/attr/noreturn.h +48 -0
- data/ext/pack/ruby/internal/attr/pure.h +43 -0
- data/ext/pack/ruby/internal/attr/restrict.h +45 -0
- data/ext/pack/ruby/internal/attr/returns_nonnull.h +37 -0
- data/ext/pack/ruby/internal/attr/warning.h +32 -0
- data/ext/pack/ruby/internal/attr/weakref.h +32 -0
- data/ext/pack/ruby/internal/cast.h +53 -0
- data/ext/pack/ruby/internal/compiler_is.h +45 -0
- data/ext/pack/ruby/internal/compiler_is/apple.h +41 -0
- data/ext/pack/ruby/internal/compiler_is/clang.h +38 -0
- data/ext/pack/ruby/internal/compiler_is/gcc.h +46 -0
- data/ext/pack/ruby/internal/compiler_is/intel.h +41 -0
- data/ext/pack/ruby/internal/compiler_is/msvc.h +57 -0
- data/ext/pack/ruby/internal/compiler_is/sunpro.h +55 -0
- data/ext/pack/ruby/internal/compiler_since.h +61 -0
- data/ext/pack/ruby/internal/config.h +131 -0
- data/ext/pack/ruby/internal/constant_p.h +37 -0
- data/ext/pack/ruby/internal/core.h +35 -0
- data/ext/pack/ruby/internal/core/rarray.h +275 -0
- data/ext/pack/ruby/internal/core/rbasic.h +85 -0
- data/ext/pack/ruby/internal/core/rbignum.h +51 -0
- data/ext/pack/ruby/internal/core/rclass.h +47 -0
- data/ext/pack/ruby/internal/core/rdata.h +174 -0
- data/ext/pack/ruby/internal/core/rfile.h +36 -0
- data/ext/pack/ruby/internal/core/rhash.h +62 -0
- data/ext/pack/ruby/internal/core/rmatch.h +73 -0
- data/ext/pack/ruby/internal/core/robject.h +97 -0
- data/ext/pack/ruby/internal/core/rregexp.h +84 -0
- data/ext/pack/ruby/internal/core/rstring.h +215 -0
- data/ext/pack/ruby/internal/core/rstruct.h +73 -0
- data/ext/pack/ruby/internal/core/rtypeddata.h +184 -0
- data/ext/pack/ruby/internal/ctype.h +203 -0
- data/ext/pack/ruby/internal/dllexport.h +92 -0
- data/ext/pack/ruby/internal/dosish.h +63 -0
- data/ext/pack/ruby/internal/error.h +74 -0
- data/ext/pack/ruby/internal/eval.h +50 -0
- data/ext/pack/ruby/internal/event.h +75 -0
- data/ext/pack/ruby/internal/fl_type.h +469 -0
- data/ext/pack/ruby/internal/gc.h +35 -0
- data/ext/pack/ruby/internal/glob.h +35 -0
- data/ext/pack/ruby/internal/globals.h +159 -0
- data/ext/pack/ruby/internal/has/attribute.h +164 -0
- data/ext/pack/ruby/internal/has/builtin.h +105 -0
- data/ext/pack/ruby/internal/has/c_attribute.h +38 -0
- data/ext/pack/ruby/internal/has/cpp_attribute.h +79 -0
- data/ext/pack/ruby/internal/has/declspec_attribute.h +48 -0
- data/ext/pack/ruby/internal/has/extension.h +33 -0
- data/ext/pack/ruby/internal/has/feature.h +31 -0
- data/ext/pack/ruby/internal/has/warning.h +31 -0
- data/ext/pack/ruby/internal/intern/array.h +78 -0
- data/ext/pack/ruby/internal/intern/bignum.h +105 -0
- data/ext/pack/ruby/internal/intern/class.h +57 -0
- data/ext/pack/ruby/internal/intern/compar.h +34 -0
- data/ext/pack/ruby/internal/intern/complex.h +60 -0
- data/ext/pack/ruby/internal/intern/cont.h +40 -0
- data/ext/pack/ruby/internal/intern/dir.h +33 -0
- data/ext/pack/ruby/internal/intern/enum.h +33 -0
- data/ext/pack/ruby/internal/intern/enumerator.h +79 -0
- data/ext/pack/ruby/internal/intern/error.h +82 -0
- data/ext/pack/ruby/internal/intern/eval.h +59 -0
- data/ext/pack/ruby/internal/intern/file.h +44 -0
- data/ext/pack/ruby/internal/intern/gc.h +57 -0
- data/ext/pack/ruby/internal/intern/hash.h +59 -0
- data/ext/pack/ruby/internal/intern/io.h +70 -0
- data/ext/pack/ruby/internal/intern/load.h +39 -0
- data/ext/pack/ruby/internal/intern/marshal.h +35 -0
- data/ext/pack/ruby/internal/intern/numeric.h +42 -0
- data/ext/pack/ruby/internal/intern/object.h +90 -0
- data/ext/pack/ruby/internal/intern/parse.h +64 -0
- data/ext/pack/ruby/internal/intern/proc.h +53 -0
- data/ext/pack/ruby/internal/intern/process.h +46 -0
- data/ext/pack/ruby/internal/intern/random.h +45 -0
- data/ext/pack/ruby/internal/intern/range.h +35 -0
- data/ext/pack/ruby/internal/intern/rational.h +46 -0
- data/ext/pack/ruby/internal/intern/re.h +50 -0
- data/ext/pack/ruby/internal/intern/ruby.h +37 -0
- data/ext/pack/ruby/internal/intern/select.h +52 -0
- data/ext/pack/ruby/internal/intern/select/largesize.h +103 -0
- data/ext/pack/ruby/internal/intern/select/posix.h +82 -0
- data/ext/pack/ruby/internal/intern/select/win32.h +124 -0
- data/ext/pack/ruby/internal/intern/signal.h +40 -0
- data/ext/pack/ruby/internal/intern/sprintf.h +43 -0
- data/ext/pack/ruby/internal/intern/string.h +290 -0
- data/ext/pack/ruby/internal/intern/struct.h +47 -0
- data/ext/pack/ruby/internal/intern/thread.h +76 -0
- data/ext/pack/ruby/internal/intern/time.h +52 -0
- data/ext/pack/ruby/internal/intern/variable.h +83 -0
- data/ext/pack/ruby/internal/intern/vm.h +77 -0
- data/ext/pack/ruby/internal/interpreter.h +94 -0
- data/ext/pack/ruby/internal/iterator.h +65 -0
- data/ext/pack/ruby/internal/memory.h +286 -0
- data/ext/pack/ruby/internal/method.h +39 -0
- data/ext/pack/ruby/internal/module.h +39 -0
- data/ext/pack/ruby/internal/newobj.h +73 -0
- data/ext/pack/ruby/internal/rgengc.h +199 -0
- data/ext/pack/ruby/internal/scan_args.h +394 -0
- data/ext/pack/ruby/internal/special_consts.h +204 -0
- data/ext/pack/ruby/internal/static_assert.h +77 -0
- data/ext/pack/ruby/internal/stdalign.h +124 -0
- data/ext/pack/ruby/internal/stdbool.h +51 -0
- data/ext/pack/ruby/internal/symbol.h +114 -0
- data/ext/pack/ruby/internal/token_paste.h +75 -0
- data/ext/pack/ruby/internal/value.h +66 -0
- data/ext/pack/ruby/internal/value_type.h +354 -0
- data/ext/pack/ruby/internal/variable.h +62 -0
- data/ext/pack/ruby/internal/warning_push.h +91 -0
- data/ext/pack/ruby/internal/xmalloc.h +201 -0
- data/lib/zscan.rb +1 -1
- data/readme.md +2 -0
- data/zscan.gemspec +1 -1
- metadata +162 -2
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#ifndef RUBY_BACKWARD2_LIMITS_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RUBY_BACKWARD2_LIMITS_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
|
|
11
|
+
* implementation details. Don't take them as canon. They could
|
|
12
|
+
* rapidly appear then vanish. The name (path) of this header file
|
|
13
|
+
* is also an implementation detail. Do not expect it to persist
|
|
14
|
+
* at the place it is now. Developers are free to move it anywhere
|
|
15
|
+
* anytime at will.
|
|
16
|
+
* @note To ruby-core: remember that this header can be possibly
|
|
17
|
+
* recursively included from extension libraries written in C++.
|
|
18
|
+
* Do not expect for instance `__VA_ARGS__` is always available.
|
|
19
|
+
* We assume C99 for ruby itself but we don't assume languages of
|
|
20
|
+
* extension libraries. They could be written in C++98.
|
|
21
|
+
* @brief Historical shim for `<limits.h>`.
|
|
22
|
+
*
|
|
23
|
+
* The macros in this header file are obsolescent. Does anyone really need our
|
|
24
|
+
* own definition of #CHAR_BIT today?
|
|
25
|
+
*/
|
|
26
|
+
#include "ruby/internal/config.h"
|
|
27
|
+
|
|
28
|
+
#ifdef HAVE_LIMITS_H
|
|
29
|
+
# include <limits.h>
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
#include "ruby/backward/2/long_long.h"
|
|
33
|
+
|
|
34
|
+
#ifndef LONG_MAX
|
|
35
|
+
# /* assuming 32bit(2's complement) long */
|
|
36
|
+
# define LONG_MAX 2147483647L
|
|
37
|
+
#endif
|
|
38
|
+
|
|
39
|
+
#ifndef LONG_MIN
|
|
40
|
+
# define LONG_MIN (-LONG_MAX-1)
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
#ifndef CHAR_BIT
|
|
44
|
+
# define CHAR_BIT 8
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
#ifdef LLONG_MAX
|
|
48
|
+
# /* Take that. */
|
|
49
|
+
#elif defined(LONG_LONG_MAX)
|
|
50
|
+
# define LLONG_MAX LONG_LONG_MAX
|
|
51
|
+
#elif defined(_I64_MAX)
|
|
52
|
+
# define LLONG_MAX _I64_MAX
|
|
53
|
+
#else
|
|
54
|
+
# /* assuming 64bit(2's complement) long long */
|
|
55
|
+
# define LLONG_MAX 9223372036854775807LL
|
|
56
|
+
#endif
|
|
57
|
+
|
|
58
|
+
#ifdef LLONG_MIN
|
|
59
|
+
# /* Take that. */
|
|
60
|
+
#elif defined(LONG_LONG_MIN)
|
|
61
|
+
# define LLONG_MIN LONG_LONG_MIN
|
|
62
|
+
#elif defined(_I64_MAX)
|
|
63
|
+
# define LLONG_MIN _I64_MIN
|
|
64
|
+
#else
|
|
65
|
+
# define LLONG_MIN (-LLONG_MAX-1)
|
|
66
|
+
#endif
|
|
67
|
+
|
|
68
|
+
#ifdef SIZE_MAX
|
|
69
|
+
# /* Take that. */
|
|
70
|
+
#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
|
|
71
|
+
# define SIZE_MAX ULLONG_MAX
|
|
72
|
+
# define SIZE_MIN ULLONG_MIN
|
|
73
|
+
#elif SIZEOF_SIZE_T == SIZEOF_LONG
|
|
74
|
+
# define SIZE_MAX ULONG_MAX
|
|
75
|
+
# define SIZE_MIN ULONG_MIN
|
|
76
|
+
#elif SIZEOF_SIZE_T == SIZEOF_INT
|
|
77
|
+
# define SIZE_MAX UINT_MAX
|
|
78
|
+
# define SIZE_MIN UINT_MIN
|
|
79
|
+
#else
|
|
80
|
+
# define SIZE_MAX USHRT_MAX
|
|
81
|
+
# define SIZE_MIN USHRT_MIN
|
|
82
|
+
#endif
|
|
83
|
+
|
|
84
|
+
#ifdef SSIZE_MAX
|
|
85
|
+
# /* Take that. */
|
|
86
|
+
#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
|
|
87
|
+
# define SSIZE_MAX LLONG_MAX
|
|
88
|
+
# define SSIZE_MIN LLONG_MIN
|
|
89
|
+
#elif SIZEOF_SIZE_T == SIZEOF_LONG
|
|
90
|
+
# define SSIZE_MAX LONG_MAX
|
|
91
|
+
# define SSIZE_MIN LONG_MIN
|
|
92
|
+
#elif SIZEOF_SIZE_T == SIZEOF_INT
|
|
93
|
+
# define SSIZE_MAX INT_MAX
|
|
94
|
+
# define SSIZE_MIN INT_MIN
|
|
95
|
+
#else
|
|
96
|
+
# define SSIZE_MAX SHRT_MAX
|
|
97
|
+
# define SSIZE_MIN SHRT_MIN
|
|
98
|
+
#endif
|
|
99
|
+
|
|
100
|
+
#endif /* RUBY_BACKWARD2_LIMITS_H */
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#ifndef RUBY_BACKWARD2_LONG_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RUBY_BACKWARD2_LONG_LONG_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
|
|
11
|
+
* implementation details. Don't take them as canon. They could
|
|
12
|
+
* rapidly appear then vanish. The name (path) of this header file
|
|
13
|
+
* is also an implementation detail. Do not expect it to persist
|
|
14
|
+
* at the place it is now. Developers are free to move it anywhere
|
|
15
|
+
* anytime at will.
|
|
16
|
+
* @note To ruby-core: remember that this header can be possibly
|
|
17
|
+
* recursively included from extension libraries written in C++.
|
|
18
|
+
* Do not expect for instance `__VA_ARGS__` is always available.
|
|
19
|
+
* We assume C99 for ruby itself but we don't assume languages of
|
|
20
|
+
* extension libraries. They could be written in C++98.
|
|
21
|
+
* @brief Defines old #LONG_LONG
|
|
22
|
+
*
|
|
23
|
+
* No known compiler that can compile today's ruby lacks long long.
|
|
24
|
+
* Historically MSVC was one of such compiler, but it implemented long long a
|
|
25
|
+
* while ago (some time back in 2013). The macros are for backwards
|
|
26
|
+
* compatibility only.
|
|
27
|
+
*/
|
|
28
|
+
#include "ruby/internal/config.h"
|
|
29
|
+
#include "ruby/internal/has/warning.h"
|
|
30
|
+
#include "ruby/internal/warning_push.h"
|
|
31
|
+
|
|
32
|
+
#if RBIMPL_HAS_WARNING("-Wc++11-long-long")
|
|
33
|
+
# define HAVE_TRUE_LONG_LONG 1
|
|
34
|
+
# define LONG_LONG \
|
|
35
|
+
RBIMPL_WARNING_PUSH() \
|
|
36
|
+
RBIMPL_WARNING_IGNORED(-Wc++11-long-long) \
|
|
37
|
+
long long \
|
|
38
|
+
RBIMPL_WARNING_POP()
|
|
39
|
+
|
|
40
|
+
#elif RBIMPL_HAS_WARNING("-Wlong-long")
|
|
41
|
+
# define HAVE_TRUE_LONG_LONG 1
|
|
42
|
+
# define LONG_LONG \
|
|
43
|
+
RBIMPL_WARNING_PUSH() \
|
|
44
|
+
RBIMPL_WARNING_IGNORED(-Wlong-long) \
|
|
45
|
+
long long \
|
|
46
|
+
RBIMPL_WARNING_POP()
|
|
47
|
+
|
|
48
|
+
#elif defined(HAVE_LONG_LONG)
|
|
49
|
+
# define HAVE_TRUE_LONG_LONG 1
|
|
50
|
+
# define LONG_LONG long long
|
|
51
|
+
|
|
52
|
+
#elif SIZEOF___INT64 > 0
|
|
53
|
+
# define HAVE_LONG_LONG 1
|
|
54
|
+
# define LONG_LONG __int64
|
|
55
|
+
# undef SIZEOF_LONG_LONG
|
|
56
|
+
# define SIZEOF_LONG_LONG SIZEOF___INT64
|
|
57
|
+
|
|
58
|
+
#else
|
|
59
|
+
# error Hello! Ruby developers believe this message must not happen.
|
|
60
|
+
# error If you encounter this message, can you file a bug report?
|
|
61
|
+
# error Remember to attach a detailed description of your environment.
|
|
62
|
+
# error Thank you!
|
|
63
|
+
#endif
|
|
64
|
+
|
|
65
|
+
#endif /* RBIMPL_BACKWARD2_LONG_LONG_H */
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#ifndef RUBY_BACKWARD2_R_CAST_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RUBY_BACKWARD2_R_CAST_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
|
|
11
|
+
* implementation details. Don't take them as canon. They could
|
|
12
|
+
* rapidly appear then vanish. The name (path) of this header file
|
|
13
|
+
* is also an implementation detail. Do not expect it to persist
|
|
14
|
+
* at the place it is now. Developers are free to move it anywhere
|
|
15
|
+
* anytime at will.
|
|
16
|
+
* @note To ruby-core: remember that this header can be possibly
|
|
17
|
+
* recursively included from extension libraries written in C++.
|
|
18
|
+
* Do not expect for instance `__VA_ARGS__` is always available.
|
|
19
|
+
* We assume C99 for ruby itself but we don't assume languages of
|
|
20
|
+
* extension libraries. They could be written in C++98.
|
|
21
|
+
* @brief Defines old #R_CAST
|
|
22
|
+
*
|
|
23
|
+
* Nobody is actively using this macro.
|
|
24
|
+
*/
|
|
25
|
+
#define R_CAST(st) (struct st*)
|
|
26
|
+
#define RMOVED(obj) (R_CAST(RMoved)(obj))
|
|
27
|
+
#endif /* RUBY_BACKWARD2_R_CAST_H */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#ifndef RUBY_BACKWARD2_RMODULE_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RUBY_BACKWARD2_RMODULE_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
|
|
11
|
+
* implementation details. Don't take them as canon. They could
|
|
12
|
+
* rapidly appear then vanish. The name (path) of this header file
|
|
13
|
+
* is also an implementation detail. Do not expect it to persist
|
|
14
|
+
* at the place it is now. Developers are free to move it anywhere
|
|
15
|
+
* anytime at will.
|
|
16
|
+
* @note To ruby-core: remember that this header can be possibly
|
|
17
|
+
* recursively included from extension libraries written in C++.
|
|
18
|
+
* Do not expect for instance `__VA_ARGS__` is always available.
|
|
19
|
+
* We assume C99 for ruby itself but we don't assume languages of
|
|
20
|
+
* extension libraries. They could be written in C++98.
|
|
21
|
+
* @brief Orphan macros.
|
|
22
|
+
*
|
|
23
|
+
* These macros seems broken since at least 2011. Nobody (except ruby itself
|
|
24
|
+
* who is implementing the internals) could have used those macros for a while.
|
|
25
|
+
* Kept public as-is here to keep some theoretical backwards compatibility.
|
|
26
|
+
*/
|
|
27
|
+
#define RMODULE_IV_TBL(m) RCLASS_IV_TBL(m)
|
|
28
|
+
#define RMODULE_CONST_TBL(m) RCLASS_CONST_TBL(m)
|
|
29
|
+
#define RMODULE_M_TBL(m) RCLASS_M_TBL(m)
|
|
30
|
+
#define RMODULE_SUPER(m) RCLASS_SUPER(m)
|
|
31
|
+
#endif /* RUBY_BACKWARD2_RMODULE_H */
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#ifndef RUBY_BACKWARD2_STDALIGN_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RUBY_BACKWARD2_STDALIGN_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
|
|
11
|
+
* implementation details. Don't take them as canon. They could
|
|
12
|
+
* rapidly appear then vanish. The name (path) of this header file
|
|
13
|
+
* is also an implementation detail. Do not expect it to persist
|
|
14
|
+
* at the place it is now. Developers are free to move it anywhere
|
|
15
|
+
* anytime at will.
|
|
16
|
+
* @note To ruby-core: remember that this header can be possibly
|
|
17
|
+
* recursively included from extension libraries written in C++.
|
|
18
|
+
* Do not expect for instance `__VA_ARGS__` is always available.
|
|
19
|
+
* We assume C99 for ruby itself but we don't assume languages of
|
|
20
|
+
* extension libraries. They could be written in C++98.
|
|
21
|
+
* @brief Defines #RUBY_ALIGNAS / #RUBY_ALIGNOF
|
|
22
|
+
*/
|
|
23
|
+
#include "ruby/internal/stdalign.h"
|
|
24
|
+
|
|
25
|
+
#undef RUBY_ALIGNAS
|
|
26
|
+
#undef RUBY_ALIGNOF
|
|
27
|
+
#define RUBY_ALIGNAS RBIMPL_ALIGNAS
|
|
28
|
+
#define RUBY_ALIGNOF RBIMPL_ALIGNOF
|
|
29
|
+
|
|
30
|
+
#endif /* RUBY_BACKWARD2_STDALIGN_H */
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#ifndef RUBY_BACKWARD2_STDARG_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RUBY_BACKWARD2_STDARG_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
|
|
11
|
+
* implementation details. Don't take them as canon. They could
|
|
12
|
+
* rapidly appear then vanish. The name (path) of this header file
|
|
13
|
+
* is also an implementation detail. Do not expect it to persist
|
|
14
|
+
* at the place it is now. Developers are free to move it anywhere
|
|
15
|
+
* anytime at will.
|
|
16
|
+
* @note To ruby-core: remember that this header can be possibly
|
|
17
|
+
* recursively included from extension libraries written in C++.
|
|
18
|
+
* Do not expect for instance `__VA_ARGS__` is always available.
|
|
19
|
+
* We assume C99 for ruby itself but we don't assume languages of
|
|
20
|
+
* extension libraries. They could be written in C++98.
|
|
21
|
+
* @brief Defines old #_
|
|
22
|
+
*
|
|
23
|
+
* Nobody should ever use these macros any longer. No konwn compilers lack
|
|
24
|
+
* prototypes today. It's 21st century. Just forget them.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
#undef _
|
|
28
|
+
#ifdef HAVE_PROTOTYPES
|
|
29
|
+
# define _(args) args
|
|
30
|
+
#else
|
|
31
|
+
# define _(args) ()
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
#undef __
|
|
35
|
+
#ifdef HAVE_STDARG_PROTOTYPES
|
|
36
|
+
# define __(args) args
|
|
37
|
+
#else
|
|
38
|
+
# define __(args) ()
|
|
39
|
+
#endif
|
|
40
|
+
|
|
41
|
+
#ifdef __cplusplus
|
|
42
|
+
#define ANYARGS ...
|
|
43
|
+
#else
|
|
44
|
+
#define ANYARGS
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
#endif /* RUBY_BACKWARD2_STDARG_H */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#ifndef RUBY_BACKWARD_CLASSEXT_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RUBY_BACKWARD_CLASSEXT_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
*/
|
|
11
|
+
#if defined __GNUC__
|
|
12
|
+
#warning use of RClass internals is deprecated
|
|
13
|
+
#elif defined _MSC_VER
|
|
14
|
+
#pragma message("warning: use of RClass internals is deprecated")
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
typedef struct rb_deprecated_classext_struct {
|
|
18
|
+
VALUE super;
|
|
19
|
+
} rb_deprecated_classext_t;
|
|
20
|
+
|
|
21
|
+
#undef RCLASS_SUPER(c)
|
|
22
|
+
#define RCLASS_EXT(c) ((rb_deprecated_classext_t *)RCLASS(c)->ptr)
|
|
23
|
+
#define RCLASS_SUPER(c) (RCLASS(c)->super)
|
|
24
|
+
|
|
25
|
+
#endif /* RUBY_BACKWARD_CLASSEXT_H */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#ifndef RUBY_BACKWARD_RUBYIO_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RUBY_BACKWARD_RUBYIO_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
*/
|
|
11
|
+
#if defined __GNUC__
|
|
12
|
+
#warning use "ruby/io.h" instead of "rubyio.h"
|
|
13
|
+
#elif defined _MSC_VER
|
|
14
|
+
#pragma message("warning: use \"ruby/io.h\" instead of \"rubyio.h\"")
|
|
15
|
+
#endif
|
|
16
|
+
#include "ruby/io.h"
|
|
17
|
+
|
|
18
|
+
#endif /* RUBY_BACKWARD_RUBYIO_H */
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#ifndef RUBYSIG_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RUBYSIG_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author $Author$
|
|
6
|
+
* @date Wed Aug 16 01:15:38 JST 1995
|
|
7
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
8
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
9
|
+
* modify this file, provided that the conditions mentioned in the
|
|
10
|
+
* file COPYING are met. Consult the file for details.
|
|
11
|
+
*/
|
|
12
|
+
#if defined __GNUC__
|
|
13
|
+
#warning rubysig.h is obsolete
|
|
14
|
+
#elif defined _MSC_VER
|
|
15
|
+
#pragma message("warning: rubysig.h is obsolete")
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
#include "ruby/ruby.h"
|
|
19
|
+
|
|
20
|
+
#define RUBY_CRITICAL(statements) do {statements;} while (0)
|
|
21
|
+
#define DEFER_INTS (0)
|
|
22
|
+
#define ENABLE_INTS (1)
|
|
23
|
+
#define ALLOW_INTS do {CHECK_INTS;} while (0)
|
|
24
|
+
#define CHECK_INTS rb_thread_check_ints()
|
|
25
|
+
|
|
26
|
+
#endif /* RUBYSIG_H */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#ifndef RUBY_BACKWARD_ST_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RUBY_BACKWARD_ST_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
*/
|
|
11
|
+
#if defined __GNUC__
|
|
12
|
+
#warning use "ruby/st.h" instead of bare "st.h"
|
|
13
|
+
#elif defined _MSC_VER
|
|
14
|
+
#pragma message("warning: use \"ruby/st.h\" instead of bare \"st.h\"")
|
|
15
|
+
#endif
|
|
16
|
+
#include "ruby/st.h"
|
|
17
|
+
|
|
18
|
+
#endif /* RUBY_BACKWARD_ST_H */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#ifndef RUBY_BACKWARD_UTIL_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RUBY_BACKWARD_UTIL_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
*/
|
|
11
|
+
#if defined __GNUC__
|
|
12
|
+
#warning use "ruby/util.h" instead of bare "util.h"
|
|
13
|
+
#elif defined _MSC_VER
|
|
14
|
+
#pragma message("warning: use \"ruby/util.h\" instead of bare \"util.h\"")
|
|
15
|
+
#endif
|
|
16
|
+
#include "ruby/util.h"
|
|
17
|
+
|
|
18
|
+
#endif /* RUBY_BACKWARD_UTIL_H */
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
#ifndef RBIMPL_ANYARGS_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RBIMPL_ANYARGS_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
* @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
|
|
11
|
+
* implementation details. Don't take them as canon. They could
|
|
12
|
+
* rapidly appear then vanish. The name (path) of this header file
|
|
13
|
+
* is also an implementation detail. Do not expect it to persist
|
|
14
|
+
* at the place it is now. Developers are free to move it anywhere
|
|
15
|
+
* anytime at will.
|
|
16
|
+
* @note To ruby-core: remember that this header can be possibly
|
|
17
|
+
* recursively included from extension libraries written in C++.
|
|
18
|
+
* Do not expect for instance `__VA_ARGS__` is always available.
|
|
19
|
+
* We assume C99 for ruby itself but we don't assume languages of
|
|
20
|
+
* extension libraries. They could be written in C++98.
|
|
21
|
+
* @brief Function overloads to issue warnings around #ANYARGS.
|
|
22
|
+
*
|
|
23
|
+
* For instance ::rb_define_method takes a pointer to #ANYARGS -ed functions,
|
|
24
|
+
* which in fact varies 18 different prototypes. We still need to preserve
|
|
25
|
+
* #ANYARGS for storages but why not check the consistencies if possible. With
|
|
26
|
+
* those complex macro overlays defined in this header file, use of a function
|
|
27
|
+
* pointer gets checked against the corresponding arity argument.
|
|
28
|
+
*
|
|
29
|
+
* ### Q&A ###
|
|
30
|
+
*
|
|
31
|
+
* - Q: Where did the magic number "18" came from in the description above?
|
|
32
|
+
*
|
|
33
|
+
* - A: Count the case branch of `vm_method.c:call_cfunc_invoker_func()`. Note
|
|
34
|
+
* also that the 18 branches has lasted for at least 25 years. See also
|
|
35
|
+
* commit 200e0ee2fd3c1c006c528874a88f684447215524.
|
|
36
|
+
*
|
|
37
|
+
* - Q: What is this `__weakref__` thing?
|
|
38
|
+
*
|
|
39
|
+
* - A: That is a kind of function overloading mechanism that GCC provides. In
|
|
40
|
+
* this case for instance `rb_define_method_00` is an alias of
|
|
41
|
+
* ::rb_define_method, with a strong type.
|
|
42
|
+
*
|
|
43
|
+
* - Q: What is this `__transparent_union__` thing?
|
|
44
|
+
*
|
|
45
|
+
* A: That is another kind of function overloading mechanism that GCC
|
|
46
|
+
* provides. In this case the attributed function pointer is either
|
|
47
|
+
* `VALUE(*)(int,VALUE*,VALUE)` or `VALUE(*)(int,const VALUE*,VALUE)`.
|
|
48
|
+
*
|
|
49
|
+
* This is better than `void*` or #ANYARGS because we can reject all other
|
|
50
|
+
* possibilities than the two.
|
|
51
|
+
*
|
|
52
|
+
* - Q: What does this #rb_define_method macro mean?
|
|
53
|
+
*
|
|
54
|
+
* - A: It selects appropriate alias of the ::rb_define_method function,
|
|
55
|
+
* depending on the last (arity) argument.
|
|
56
|
+
*
|
|
57
|
+
* - Q: Why the special case for ::rb_f_notimplement ?
|
|
58
|
+
*
|
|
59
|
+
* - A: Function pointer to ::rb_f_notimplement is special cased in
|
|
60
|
+
* `vm_method.c:rb_add_method_cfunc()`. That should be handled by the
|
|
61
|
+
* `__builtin_choose_expr` chain inside of #rb_define_method macro
|
|
62
|
+
* expansion. In order to do so, comparison like
|
|
63
|
+
* `(func == rb_f_notimplement)` is inappropriate for
|
|
64
|
+
* `__builtin_choose_expr`'s expression (which must be a compile-time
|
|
65
|
+
* integer constant but the address of ::rb_f_notimplement is not fixed
|
|
66
|
+
* until the linker). Instead we are using
|
|
67
|
+
* `__builtin_types_compatible_p`, and in doing so we need to distinguish
|
|
68
|
+
* ::rb_f_notimplement from others, by type.
|
|
69
|
+
*/
|
|
70
|
+
#include "ruby/internal/attr/maybe_unused.h"
|
|
71
|
+
#include "ruby/internal/attr/nonnull.h"
|
|
72
|
+
#include "ruby/internal/attr/weakref.h"
|
|
73
|
+
#include "ruby/internal/cast.h"
|
|
74
|
+
#include "ruby/internal/config.h"
|
|
75
|
+
#include "ruby/internal/has/attribute.h"
|
|
76
|
+
#include "ruby/internal/intern/class.h"
|
|
77
|
+
#include "ruby/internal/intern/vm.h"
|
|
78
|
+
#include "ruby/internal/method.h"
|
|
79
|
+
#include "ruby/internal/value.h"
|
|
80
|
+
#include "ruby/backward/2/stdarg.h"
|
|
81
|
+
|
|
82
|
+
#if defined(__cplusplus)
|
|
83
|
+
# include "ruby/backward/cxxanyargs.hpp"
|
|
84
|
+
|
|
85
|
+
#elif defined(_WIN32) || defined(__CYGWIN__)
|
|
86
|
+
# /* Skip due to [Bug #16134] */
|
|
87
|
+
|
|
88
|
+
#elif ! RBIMPL_HAS_ATTRIBUTE(transparent_union)
|
|
89
|
+
# /* :TODO: improve here, please find a way to support. */
|
|
90
|
+
|
|
91
|
+
#elif ! defined(HAVE_VA_ARGS_MACRO)
|
|
92
|
+
# /* :TODO: improve here, please find a way to support. */
|
|
93
|
+
|
|
94
|
+
#else
|
|
95
|
+
# /** @cond INTERNAL_MACRO */
|
|
96
|
+
# if ! defined(HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P)
|
|
97
|
+
# define RBIMPL_CFUNC_IS_rb_f_notimplement(f) 0
|
|
98
|
+
# else
|
|
99
|
+
# define RBIMPL_CFUNC_IS_rb_f_notimplement(f) \
|
|
100
|
+
__builtin_types_compatible_p( \
|
|
101
|
+
__typeof__(f), \
|
|
102
|
+
__typeof__(rb_f_notimplement))
|
|
103
|
+
# endif
|
|
104
|
+
|
|
105
|
+
# if ! defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
|
|
106
|
+
# define RBIMPL_ANYARGS_DISPATCH(expr, truthy, falsy) (falsy)
|
|
107
|
+
# else
|
|
108
|
+
# define RBIMPL_ANYARGS_DISPATCH(expr, truthy, falsy) \
|
|
109
|
+
__builtin_choose_expr( \
|
|
110
|
+
__builtin_choose_expr( \
|
|
111
|
+
__builtin_constant_p(expr), \
|
|
112
|
+
(expr), 0), \
|
|
113
|
+
(truthy), (falsy))
|
|
114
|
+
# endif
|
|
115
|
+
|
|
116
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_singleton_method_m2, rb_define_singleton_method_m3)
|
|
117
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_singleton_method_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_m2(n))
|
|
118
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_singleton_method_00, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_m1(n))
|
|
119
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_singleton_method_01, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_00(n))
|
|
120
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_singleton_method_02, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_01(n))
|
|
121
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_singleton_method_03, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_02(n))
|
|
122
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_singleton_method_04, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_03(n))
|
|
123
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_singleton_method_05, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_04(n))
|
|
124
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_singleton_method_06, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_05(n))
|
|
125
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_singleton_method_07, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_06(n))
|
|
126
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_singleton_method_08, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_07(n))
|
|
127
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_singleton_method_09, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_08(n))
|
|
128
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_singleton_method_10, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_09(n))
|
|
129
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_singleton_method_11, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_10(n))
|
|
130
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_singleton_method_12, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_11(n))
|
|
131
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_singleton_method_13, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_12(n))
|
|
132
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_singleton_method_14, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_13(n))
|
|
133
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_singleton_method_15, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_14(n))
|
|
134
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_protected_method_m2, rb_define_protected_method_m3)
|
|
135
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_protected_method_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_m2(n))
|
|
136
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_protected_method_00, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_m1(n))
|
|
137
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_protected_method_01, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_00(n))
|
|
138
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_protected_method_02, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_01(n))
|
|
139
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_protected_method_03, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_02(n))
|
|
140
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_protected_method_04, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_03(n))
|
|
141
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_protected_method_05, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_04(n))
|
|
142
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_protected_method_06, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_05(n))
|
|
143
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_protected_method_07, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_06(n))
|
|
144
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_protected_method_08, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_07(n))
|
|
145
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_protected_method_09, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_08(n))
|
|
146
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_protected_method_10, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_09(n))
|
|
147
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_protected_method_11, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_10(n))
|
|
148
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_protected_method_12, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_11(n))
|
|
149
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_protected_method_13, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_12(n))
|
|
150
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_protected_method_14, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_13(n))
|
|
151
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_protected_method_15, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_14(n))
|
|
152
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_private_method_m2, rb_define_private_method_m3)
|
|
153
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_private_method_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_m2(n))
|
|
154
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_private_method_00, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_m1(n))
|
|
155
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_private_method_01, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_00(n))
|
|
156
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_private_method_02, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_01(n))
|
|
157
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_private_method_03, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_02(n))
|
|
158
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_private_method_04, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_03(n))
|
|
159
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_private_method_05, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_04(n))
|
|
160
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_private_method_06, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_05(n))
|
|
161
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_private_method_07, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_06(n))
|
|
162
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_private_method_08, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_07(n))
|
|
163
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_private_method_09, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_08(n))
|
|
164
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_private_method_10, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_09(n))
|
|
165
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_private_method_11, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_10(n))
|
|
166
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_private_method_12, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_11(n))
|
|
167
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_private_method_13, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_12(n))
|
|
168
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_private_method_14, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_13(n))
|
|
169
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_private_method_15, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_14(n))
|
|
170
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_module_function_m2, rb_define_module_function_m3)
|
|
171
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_module_function_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_m2(n))
|
|
172
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_module_function_00, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_m1(n))
|
|
173
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_module_function_01, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_00(n))
|
|
174
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_module_function_02, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_01(n))
|
|
175
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_module_function_03, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_02(n))
|
|
176
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_module_function_04, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_03(n))
|
|
177
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_module_function_05, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_04(n))
|
|
178
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_module_function_06, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_05(n))
|
|
179
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_module_function_07, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_06(n))
|
|
180
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_module_function_08, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_07(n))
|
|
181
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_module_function_09, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_08(n))
|
|
182
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_module_function_10, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_09(n))
|
|
183
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_module_function_11, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_10(n))
|
|
184
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_module_function_12, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_11(n))
|
|
185
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_module_function_13, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_12(n))
|
|
186
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_module_function_14, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_13(n))
|
|
187
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_module_function_15, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_14(n))
|
|
188
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_global_function_m2, rb_define_global_function_m3)
|
|
189
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_global_function_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_m2(n))
|
|
190
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_global_function_00, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_m1(n))
|
|
191
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_global_function_01, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_00(n))
|
|
192
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_global_function_02, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_01(n))
|
|
193
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_global_function_03, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_02(n))
|
|
194
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_global_function_04, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_03(n))
|
|
195
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_global_function_05, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_04(n))
|
|
196
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_global_function_06, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_05(n))
|
|
197
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_global_function_07, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_06(n))
|
|
198
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_global_function_08, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_07(n))
|
|
199
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_global_function_09, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_08(n))
|
|
200
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_global_function_10, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_09(n))
|
|
201
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_global_function_11, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_10(n))
|
|
202
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_global_function_12, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_11(n))
|
|
203
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_global_function_13, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_12(n))
|
|
204
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_global_function_14, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_13(n))
|
|
205
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_global_function_15, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_14(n))
|
|
206
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_method_id_m2, rb_define_method_id_m3)
|
|
207
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_method_id_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_m2(n))
|
|
208
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_method_id_00, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_m1(n))
|
|
209
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_method_id_01, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_00(n))
|
|
210
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_method_id_02, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_01(n))
|
|
211
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_method_id_03, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_02(n))
|
|
212
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_method_id_04, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_03(n))
|
|
213
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_method_id_05, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_04(n))
|
|
214
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_method_id_06, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_05(n))
|
|
215
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_method_id_07, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_06(n))
|
|
216
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_method_id_08, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_07(n))
|
|
217
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_method_id_09, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_08(n))
|
|
218
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_method_id_10, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_09(n))
|
|
219
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_method_id_11, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_10(n))
|
|
220
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_method_id_12, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_11(n))
|
|
221
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_method_id_13, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_12(n))
|
|
222
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_method_id_14, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_13(n))
|
|
223
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_method_id_15, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_14(n))
|
|
224
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_m2(n) RBIMPL_ANYARGS_DISPATCH((n) == -2, rb_define_method_m2, rb_define_method_m3)
|
|
225
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_m1(n) RBIMPL_ANYARGS_DISPATCH((n) == -1, rb_define_method_m1, RBIMPL_ANYARGS_DISPATCH_rb_define_method_m2(n))
|
|
226
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_00(n) RBIMPL_ANYARGS_DISPATCH((n) == 0, rb_define_method_00, RBIMPL_ANYARGS_DISPATCH_rb_define_method_m1(n))
|
|
227
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_01(n) RBIMPL_ANYARGS_DISPATCH((n) == 1, rb_define_method_01, RBIMPL_ANYARGS_DISPATCH_rb_define_method_00(n))
|
|
228
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_02(n) RBIMPL_ANYARGS_DISPATCH((n) == 2, rb_define_method_02, RBIMPL_ANYARGS_DISPATCH_rb_define_method_01(n))
|
|
229
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_03(n) RBIMPL_ANYARGS_DISPATCH((n) == 3, rb_define_method_03, RBIMPL_ANYARGS_DISPATCH_rb_define_method_02(n))
|
|
230
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_04(n) RBIMPL_ANYARGS_DISPATCH((n) == 4, rb_define_method_04, RBIMPL_ANYARGS_DISPATCH_rb_define_method_03(n))
|
|
231
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_05(n) RBIMPL_ANYARGS_DISPATCH((n) == 5, rb_define_method_05, RBIMPL_ANYARGS_DISPATCH_rb_define_method_04(n))
|
|
232
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_06(n) RBIMPL_ANYARGS_DISPATCH((n) == 6, rb_define_method_06, RBIMPL_ANYARGS_DISPATCH_rb_define_method_05(n))
|
|
233
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_07(n) RBIMPL_ANYARGS_DISPATCH((n) == 7, rb_define_method_07, RBIMPL_ANYARGS_DISPATCH_rb_define_method_06(n))
|
|
234
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_08(n) RBIMPL_ANYARGS_DISPATCH((n) == 8, rb_define_method_08, RBIMPL_ANYARGS_DISPATCH_rb_define_method_07(n))
|
|
235
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_09(n) RBIMPL_ANYARGS_DISPATCH((n) == 9, rb_define_method_09, RBIMPL_ANYARGS_DISPATCH_rb_define_method_08(n))
|
|
236
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_10(n) RBIMPL_ANYARGS_DISPATCH((n) == 10, rb_define_method_10, RBIMPL_ANYARGS_DISPATCH_rb_define_method_09(n))
|
|
237
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_11(n) RBIMPL_ANYARGS_DISPATCH((n) == 11, rb_define_method_11, RBIMPL_ANYARGS_DISPATCH_rb_define_method_10(n))
|
|
238
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_12(n) RBIMPL_ANYARGS_DISPATCH((n) == 12, rb_define_method_12, RBIMPL_ANYARGS_DISPATCH_rb_define_method_11(n))
|
|
239
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_13(n) RBIMPL_ANYARGS_DISPATCH((n) == 13, rb_define_method_13, RBIMPL_ANYARGS_DISPATCH_rb_define_method_12(n))
|
|
240
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_14(n) RBIMPL_ANYARGS_DISPATCH((n) == 14, rb_define_method_14, RBIMPL_ANYARGS_DISPATCH_rb_define_method_13(n))
|
|
241
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_15(n) RBIMPL_ANYARGS_DISPATCH((n) == 15, rb_define_method_15, RBIMPL_ANYARGS_DISPATCH_rb_define_method_14(n))
|
|
242
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_singleton_method_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method_15(n))
|
|
243
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_protected_method_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method_15(n))
|
|
244
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_private_method(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_private_method_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_private_method_15(n))
|
|
245
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_module_function(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_module_function_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_module_function_15(n))
|
|
246
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_global_function(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_global_function_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_global_function_15(n))
|
|
247
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method_id(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_method_id_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_method_id_15(n))
|
|
248
|
+
# define RBIMPL_ANYARGS_DISPATCH_rb_define_method(n, f) RBIMPL_ANYARGS_DISPATCH(RBIMPL_CFUNC_IS_rb_f_notimplement(f), rb_define_method_m3, RBIMPL_ANYARGS_DISPATCH_rb_define_method_15(n))
|
|
249
|
+
# define RBIMPL_ANYARGS_ATTRSET(sym) RBIMPL_ATTR_MAYBE_UNUSED() RBIMPL_ATTR_NONNULL() RBIMPL_ATTR_WEAKREF(sym)
|
|
250
|
+
# define RBIMPL_ANYARGS_DECL(sym, ...) \
|
|
251
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _m3(__VA_ARGS__, VALUE(*)(ANYARGS), int); \
|
|
252
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _m2(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
|
|
253
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _m1(__VA_ARGS__, VALUE(*)(int, union { VALUE *x; const VALUE *y; } __attribute__((__transparent_union__)), VALUE), int); \
|
|
254
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _00(__VA_ARGS__, VALUE(*)(VALUE), int); \
|
|
255
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
|
|
256
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _02(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE), int); \
|
|
257
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _03(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE), int); \
|
|
258
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _04(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE), int); \
|
|
259
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _05(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
|
|
260
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _06(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
|
|
261
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _07(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
|
|
262
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _08(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
|
|
263
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _09(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
|
|
264
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _10(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
|
|
265
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _11(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
|
|
266
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _12(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
|
|
267
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _13(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
|
|
268
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _14(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int); \
|
|
269
|
+
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _15(__VA_ARGS__, VALUE(*)(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE), int);
|
|
270
|
+
RBIMPL_ANYARGS_DECL(rb_define_singleton_method, VALUE, const char *)
|
|
271
|
+
RBIMPL_ANYARGS_DECL(rb_define_protected_method, VALUE, const char *)
|
|
272
|
+
RBIMPL_ANYARGS_DECL(rb_define_private_method, VALUE, const char *)
|
|
273
|
+
RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
|
|
274
|
+
RBIMPL_ANYARGS_DECL(rb_define_global_function, const char *)
|
|
275
|
+
RBIMPL_ANYARGS_DECL(rb_define_method_id, VALUE, ID)
|
|
276
|
+
RBIMPL_ANYARGS_DECL(rb_define_method, VALUE, const char *)
|
|
277
|
+
/** @endcond */
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* @brief Defines klass\#mid.
|
|
281
|
+
* @see ::rb_define_method
|
|
282
|
+
* @param klass Where the method lives.
|
|
283
|
+
* @param mid Name of the defining method.
|
|
284
|
+
* @param func Implementation of klass\#mid.
|
|
285
|
+
* @param arity Arity of klass\#mid.
|
|
286
|
+
*/
|
|
287
|
+
#define rb_define_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity))
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* @brief Defines klass\#mid.
|
|
291
|
+
* @see ::rb_define_method_id
|
|
292
|
+
* @param klass Where the method lives.
|
|
293
|
+
* @param mid Name of the defining method.
|
|
294
|
+
* @param func Implementation of klass\#mid.
|
|
295
|
+
* @param arity Arity of klass\#mid.
|
|
296
|
+
*/
|
|
297
|
+
#define rb_define_method_id(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_method_id((arity), (func))((klass), (mid), (func), (arity))
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* @brief Defines obj.mid.
|
|
301
|
+
* @see ::rb_define_singleton_method
|
|
302
|
+
* @param obj Where the method lives.
|
|
303
|
+
* @param mid Name of the defining method.
|
|
304
|
+
* @param func Implementation of obj.mid.
|
|
305
|
+
* @param arity Arity of obj.mid.
|
|
306
|
+
*/
|
|
307
|
+
#define rb_define_singleton_method(obj, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method((arity), (func))((obj), (mid), (func), (arity))
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* @brief Defines klass\#mid and make it protected.
|
|
311
|
+
* @see ::rb_define_protected_method
|
|
312
|
+
* @param klass Where the method lives.
|
|
313
|
+
* @param mid Name of the defining method.
|
|
314
|
+
* @param func Implementation of klass\#mid.
|
|
315
|
+
* @param arity Arity of klass\#mid.
|
|
316
|
+
*/
|
|
317
|
+
#define rb_define_protected_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_protected_method((arity), (func))((klass), (mid), (func), (arity))
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* @brief Defines klass\#mid and make it private.
|
|
321
|
+
* @see ::rb_define_private_method
|
|
322
|
+
* @param klass Where the method lives.
|
|
323
|
+
* @param mid Name of the defining method.
|
|
324
|
+
* @param func Implementation of klass\#mid.
|
|
325
|
+
* @param arity Arity of klass\#mid.
|
|
326
|
+
*/
|
|
327
|
+
#define rb_define_private_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_private_method((arity), (func))((klass), (mid), (func), (arity))
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @brief Defines mod\#mid and make it a module function.
|
|
331
|
+
* @see ::rb_define_module_function
|
|
332
|
+
* @param mod Where the method lives.
|
|
333
|
+
* @param mid Name of the defining method.
|
|
334
|
+
* @param func Implementation of mod\#mid.
|
|
335
|
+
* @param arity Arity of mod\#mid.
|
|
336
|
+
*/
|
|
337
|
+
#define rb_define_module_function(mod, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity))
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* @brief Defines ::rb_mKerbel \#mid.
|
|
341
|
+
* @see ::rb_define_gobal_function
|
|
342
|
+
* @param mid Name of the defining method.
|
|
343
|
+
* @param func Implementation of ::rb_mKernel \#mid.
|
|
344
|
+
* @param arity Arity of ::rb_mKernel \#mid.
|
|
345
|
+
*/
|
|
346
|
+
#define rb_define_global_function(mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_global_function((arity), (func))((mid), (func), (arity))
|
|
347
|
+
|
|
348
|
+
#endif /* __cplusplus */
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* This macro is to properly cast a function parameter of *_define_method
|
|
352
|
+
* family. It has been around since 1.x era so you can maximize backwards
|
|
353
|
+
* compatibility by using it.
|
|
354
|
+
*
|
|
355
|
+
* ```CXX
|
|
356
|
+
* rb_define_method(klass, "method", RUBY_METHOD_FUNC(func), arity);
|
|
357
|
+
* ```
|
|
358
|
+
*
|
|
359
|
+
* @param func A pointer to a function that implements a method.
|
|
360
|
+
*/
|
|
361
|
+
#if ! defined(RUBY_DEVEL)
|
|
362
|
+
# define RUBY_METHOD_FUNC(func) RBIMPL_CAST((VALUE (*)(ANYARGS))(func))
|
|
363
|
+
|
|
364
|
+
#elif ! RUBY_DEVEL
|
|
365
|
+
# define RUBY_METHOD_FUNC(func) RBIMPL_CAST((VALUE (*)(ANYARGS))(func))
|
|
366
|
+
|
|
367
|
+
#elif ! defined(rb_define_method)
|
|
368
|
+
# define RUBY_METHOD_FUNC(func) RBIMPL_CAST((VALUE (*)(ANYARGS))(func))
|
|
369
|
+
|
|
370
|
+
#else
|
|
371
|
+
# define RUBY_METHOD_FUNC(func) (func)
|
|
372
|
+
|
|
373
|
+
#endif
|
|
374
|
+
|
|
375
|
+
#endif /* RBIMPL_ANYARGS_H */
|