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.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/ext/pack/pack-27.c +1 -0
  3. data/ext/pack/pack.c +1 -0
  4. data/ext/pack/ruby/backward/2/assume.h +43 -0
  5. data/ext/pack/ruby/backward/2/attributes.h +157 -0
  6. data/ext/pack/ruby/backward/2/bool.h +37 -0
  7. data/ext/pack/ruby/backward/2/extern.h +46 -0
  8. data/ext/pack/ruby/backward/2/gcc_version_since.h +38 -0
  9. data/ext/pack/ruby/backward/2/inttypes.h +132 -0
  10. data/ext/pack/ruby/backward/2/limits.h +100 -0
  11. data/ext/pack/ruby/backward/2/long_long.h +65 -0
  12. data/ext/pack/ruby/backward/2/r_cast.h +27 -0
  13. data/ext/pack/ruby/backward/2/rmodule.h +31 -0
  14. data/ext/pack/ruby/backward/2/stdalign.h +30 -0
  15. data/ext/pack/ruby/backward/2/stdarg.h +47 -0
  16. data/ext/pack/ruby/backward/classext.h +25 -0
  17. data/ext/pack/ruby/backward/rubyio.h +18 -0
  18. data/ext/pack/ruby/backward/rubysig.h +26 -0
  19. data/ext/pack/ruby/backward/st.h +18 -0
  20. data/ext/pack/ruby/backward/util.h +18 -0
  21. data/ext/pack/ruby/internal/anyargs.h +375 -0
  22. data/ext/pack/ruby/internal/arithmetic.h +38 -0
  23. data/ext/pack/ruby/internal/arithmetic/char.h +58 -0
  24. data/ext/pack/ruby/internal/arithmetic/double.h +39 -0
  25. data/ext/pack/ruby/internal/arithmetic/fixnum.h +44 -0
  26. data/ext/pack/ruby/internal/arithmetic/gid_t.h +34 -0
  27. data/ext/pack/ruby/internal/arithmetic/int.h +163 -0
  28. data/ext/pack/ruby/internal/arithmetic/intptr_t.h +42 -0
  29. data/ext/pack/ruby/internal/arithmetic/long.h +244 -0
  30. data/ext/pack/ruby/internal/arithmetic/long_long.h +53 -0
  31. data/ext/pack/ruby/internal/arithmetic/mode_t.h +34 -0
  32. data/ext/pack/ruby/internal/arithmetic/off_t.h +49 -0
  33. data/ext/pack/ruby/internal/arithmetic/pid_t.h +34 -0
  34. data/ext/pack/ruby/internal/arithmetic/short.h +54 -0
  35. data/ext/pack/ruby/internal/arithmetic/size_t.h +51 -0
  36. data/ext/pack/ruby/internal/arithmetic/st_data_t.h +59 -0
  37. data/ext/pack/ruby/internal/arithmetic/uid_t.h +34 -0
  38. data/ext/pack/ruby/internal/assume.h +90 -0
  39. data/ext/pack/ruby/internal/attr/alloc_size.h +32 -0
  40. data/ext/pack/ruby/internal/attr/artificial.h +46 -0
  41. data/ext/pack/ruby/internal/attr/cold.h +37 -0
  42. data/ext/pack/ruby/internal/attr/const.h +46 -0
  43. data/ext/pack/ruby/internal/attr/constexpr.h +85 -0
  44. data/ext/pack/ruby/internal/attr/deprecated.h +59 -0
  45. data/ext/pack/ruby/internal/attr/diagnose_if.h +42 -0
  46. data/ext/pack/ruby/internal/attr/enum_extensibility.h +32 -0
  47. data/ext/pack/ruby/internal/attr/error.h +32 -0
  48. data/ext/pack/ruby/internal/attr/flag_enum.h +33 -0
  49. data/ext/pack/ruby/internal/attr/forceinline.h +40 -0
  50. data/ext/pack/ruby/internal/attr/format.h +38 -0
  51. data/ext/pack/ruby/internal/attr/maybe_unused.h +38 -0
  52. data/ext/pack/ruby/internal/attr/noalias.h +58 -0
  53. data/ext/pack/ruby/internal/attr/nodiscard.h +45 -0
  54. data/ext/pack/ruby/internal/attr/noexcept.h +91 -0
  55. data/ext/pack/ruby/internal/attr/noinline.h +35 -0
  56. data/ext/pack/ruby/internal/attr/nonnull.h +32 -0
  57. data/ext/pack/ruby/internal/attr/noreturn.h +48 -0
  58. data/ext/pack/ruby/internal/attr/pure.h +43 -0
  59. data/ext/pack/ruby/internal/attr/restrict.h +45 -0
  60. data/ext/pack/ruby/internal/attr/returns_nonnull.h +37 -0
  61. data/ext/pack/ruby/internal/attr/warning.h +32 -0
  62. data/ext/pack/ruby/internal/attr/weakref.h +32 -0
  63. data/ext/pack/ruby/internal/cast.h +53 -0
  64. data/ext/pack/ruby/internal/compiler_is.h +45 -0
  65. data/ext/pack/ruby/internal/compiler_is/apple.h +41 -0
  66. data/ext/pack/ruby/internal/compiler_is/clang.h +38 -0
  67. data/ext/pack/ruby/internal/compiler_is/gcc.h +46 -0
  68. data/ext/pack/ruby/internal/compiler_is/intel.h +41 -0
  69. data/ext/pack/ruby/internal/compiler_is/msvc.h +57 -0
  70. data/ext/pack/ruby/internal/compiler_is/sunpro.h +55 -0
  71. data/ext/pack/ruby/internal/compiler_since.h +61 -0
  72. data/ext/pack/ruby/internal/config.h +131 -0
  73. data/ext/pack/ruby/internal/constant_p.h +37 -0
  74. data/ext/pack/ruby/internal/core.h +35 -0
  75. data/ext/pack/ruby/internal/core/rarray.h +275 -0
  76. data/ext/pack/ruby/internal/core/rbasic.h +85 -0
  77. data/ext/pack/ruby/internal/core/rbignum.h +51 -0
  78. data/ext/pack/ruby/internal/core/rclass.h +47 -0
  79. data/ext/pack/ruby/internal/core/rdata.h +174 -0
  80. data/ext/pack/ruby/internal/core/rfile.h +36 -0
  81. data/ext/pack/ruby/internal/core/rhash.h +62 -0
  82. data/ext/pack/ruby/internal/core/rmatch.h +73 -0
  83. data/ext/pack/ruby/internal/core/robject.h +97 -0
  84. data/ext/pack/ruby/internal/core/rregexp.h +84 -0
  85. data/ext/pack/ruby/internal/core/rstring.h +215 -0
  86. data/ext/pack/ruby/internal/core/rstruct.h +73 -0
  87. data/ext/pack/ruby/internal/core/rtypeddata.h +184 -0
  88. data/ext/pack/ruby/internal/ctype.h +203 -0
  89. data/ext/pack/ruby/internal/dllexport.h +92 -0
  90. data/ext/pack/ruby/internal/dosish.h +63 -0
  91. data/ext/pack/ruby/internal/error.h +74 -0
  92. data/ext/pack/ruby/internal/eval.h +50 -0
  93. data/ext/pack/ruby/internal/event.h +75 -0
  94. data/ext/pack/ruby/internal/fl_type.h +469 -0
  95. data/ext/pack/ruby/internal/gc.h +35 -0
  96. data/ext/pack/ruby/internal/glob.h +35 -0
  97. data/ext/pack/ruby/internal/globals.h +159 -0
  98. data/ext/pack/ruby/internal/has/attribute.h +164 -0
  99. data/ext/pack/ruby/internal/has/builtin.h +105 -0
  100. data/ext/pack/ruby/internal/has/c_attribute.h +38 -0
  101. data/ext/pack/ruby/internal/has/cpp_attribute.h +79 -0
  102. data/ext/pack/ruby/internal/has/declspec_attribute.h +48 -0
  103. data/ext/pack/ruby/internal/has/extension.h +33 -0
  104. data/ext/pack/ruby/internal/has/feature.h +31 -0
  105. data/ext/pack/ruby/internal/has/warning.h +31 -0
  106. data/ext/pack/ruby/internal/intern/array.h +78 -0
  107. data/ext/pack/ruby/internal/intern/bignum.h +105 -0
  108. data/ext/pack/ruby/internal/intern/class.h +57 -0
  109. data/ext/pack/ruby/internal/intern/compar.h +34 -0
  110. data/ext/pack/ruby/internal/intern/complex.h +60 -0
  111. data/ext/pack/ruby/internal/intern/cont.h +40 -0
  112. data/ext/pack/ruby/internal/intern/dir.h +33 -0
  113. data/ext/pack/ruby/internal/intern/enum.h +33 -0
  114. data/ext/pack/ruby/internal/intern/enumerator.h +79 -0
  115. data/ext/pack/ruby/internal/intern/error.h +82 -0
  116. data/ext/pack/ruby/internal/intern/eval.h +59 -0
  117. data/ext/pack/ruby/internal/intern/file.h +44 -0
  118. data/ext/pack/ruby/internal/intern/gc.h +57 -0
  119. data/ext/pack/ruby/internal/intern/hash.h +59 -0
  120. data/ext/pack/ruby/internal/intern/io.h +70 -0
  121. data/ext/pack/ruby/internal/intern/load.h +39 -0
  122. data/ext/pack/ruby/internal/intern/marshal.h +35 -0
  123. data/ext/pack/ruby/internal/intern/numeric.h +42 -0
  124. data/ext/pack/ruby/internal/intern/object.h +90 -0
  125. data/ext/pack/ruby/internal/intern/parse.h +64 -0
  126. data/ext/pack/ruby/internal/intern/proc.h +53 -0
  127. data/ext/pack/ruby/internal/intern/process.h +46 -0
  128. data/ext/pack/ruby/internal/intern/random.h +45 -0
  129. data/ext/pack/ruby/internal/intern/range.h +35 -0
  130. data/ext/pack/ruby/internal/intern/rational.h +46 -0
  131. data/ext/pack/ruby/internal/intern/re.h +50 -0
  132. data/ext/pack/ruby/internal/intern/ruby.h +37 -0
  133. data/ext/pack/ruby/internal/intern/select.h +52 -0
  134. data/ext/pack/ruby/internal/intern/select/largesize.h +103 -0
  135. data/ext/pack/ruby/internal/intern/select/posix.h +82 -0
  136. data/ext/pack/ruby/internal/intern/select/win32.h +124 -0
  137. data/ext/pack/ruby/internal/intern/signal.h +40 -0
  138. data/ext/pack/ruby/internal/intern/sprintf.h +43 -0
  139. data/ext/pack/ruby/internal/intern/string.h +290 -0
  140. data/ext/pack/ruby/internal/intern/struct.h +47 -0
  141. data/ext/pack/ruby/internal/intern/thread.h +76 -0
  142. data/ext/pack/ruby/internal/intern/time.h +52 -0
  143. data/ext/pack/ruby/internal/intern/variable.h +83 -0
  144. data/ext/pack/ruby/internal/intern/vm.h +77 -0
  145. data/ext/pack/ruby/internal/interpreter.h +94 -0
  146. data/ext/pack/ruby/internal/iterator.h +65 -0
  147. data/ext/pack/ruby/internal/memory.h +286 -0
  148. data/ext/pack/ruby/internal/method.h +39 -0
  149. data/ext/pack/ruby/internal/module.h +39 -0
  150. data/ext/pack/ruby/internal/newobj.h +73 -0
  151. data/ext/pack/ruby/internal/rgengc.h +199 -0
  152. data/ext/pack/ruby/internal/scan_args.h +394 -0
  153. data/ext/pack/ruby/internal/special_consts.h +204 -0
  154. data/ext/pack/ruby/internal/static_assert.h +77 -0
  155. data/ext/pack/ruby/internal/stdalign.h +124 -0
  156. data/ext/pack/ruby/internal/stdbool.h +51 -0
  157. data/ext/pack/ruby/internal/symbol.h +114 -0
  158. data/ext/pack/ruby/internal/token_paste.h +75 -0
  159. data/ext/pack/ruby/internal/value.h +66 -0
  160. data/ext/pack/ruby/internal/value_type.h +354 -0
  161. data/ext/pack/ruby/internal/variable.h +62 -0
  162. data/ext/pack/ruby/internal/warning_push.h +91 -0
  163. data/ext/pack/ruby/internal/xmalloc.h +201 -0
  164. data/lib/zscan.rb +1 -1
  165. data/readme.md +2 -0
  166. data/zscan.gemspec +1 -1
  167. metadata +162 -2
@@ -0,0 +1,32 @@
1
+ #ifndef RBIMPL_ATTR_ALLOC_SIZE_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_ALLOC_SIZE_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 #RBIMPL_ATTR_ALLOC_SIZE.
22
+ */
23
+ #include "ruby/internal/has/attribute.h"
24
+
25
+ /** Wraps (or simulates) `__attribute__((alloc_size))` */
26
+ #if RBIMPL_HAS_ATTRIBUTE(alloc_size)
27
+ # define RBIMPL_ATTR_ALLOC_SIZE(tuple) __attribute__((__alloc_size__ tuple))
28
+ #else
29
+ # define RBIMPL_ATTR_ALLOC_SIZE(tuple) /* void */
30
+ #endif
31
+
32
+ #endif /* RBIMPL_ATTR_ALLOC_SIZE_H */
@@ -0,0 +1,46 @@
1
+ #ifndef RBIMPL_ATTR_ARTIFICIAL_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_ARTIFICIAL_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 #RBIMPL_ATTR_ARTIFICIAL.
22
+ *
23
+ * ### Q&A ###
24
+ *
25
+ * - Q: What is this attribute? I don't get what GCC manual is talking about.
26
+ *
27
+ * - A: In short it is an attribute to manipulate GDB backtraces. The
28
+ * attribute makes the best sense when it comes with
29
+ * __attribute__((always_inline)). When a function annotated with this
30
+ * attribute gets inlined, and when you somehow look at a backtrace which
31
+ * includes such inlined call site, then the backtrace shows the caller
32
+ * and not the callee. This is handy for instance when an identical
33
+ * function is inlined more than once in a single big function. On such
34
+ * case it gets vital to know where the inlining happened in the callee.
35
+ * See also https://stackoverflow.com/a/21936099
36
+ */
37
+ #include "ruby/internal/has/attribute.h"
38
+
39
+ /** Wraps (or simulates) `__attribute__((artificial))` */
40
+ #if RBIMPL_HAS_ATTRIBUTE(artificial)
41
+ # define RBIMPL_ATTR_ARTIFICIAL() __attribute__((__artificial__))
42
+ #else
43
+ # define RBIMPL_ATTR_ARTIFICIAL() /* void */
44
+ #endif
45
+
46
+ #endif /* RBIMPL_ATTR_ARTIFICIAL_H */
@@ -0,0 +1,37 @@
1
+ #ifndef RBIMPL_ATTR_COLD_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_COLD_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 #RBIMPL_ATTR_COLD.
22
+ */
23
+ #include "ruby/internal/compiler_is.h"
24
+ #include "ruby/internal/has/attribute.h"
25
+
26
+ /** Wraps (or simulates) `__attribute__((cold))` */
27
+ #if RBIMPL_COMPILER_IS(SunPro)
28
+ # /* Recent SunPro has __has_attribute, and is borken. */
29
+ # /* It reports it has attribute cold, reality isn't (warnings issued). */
30
+ # define RBIMPL_ATTR_COLD() /* void */
31
+ #elif RBIMPL_HAS_ATTRIBUTE(cold)
32
+ # define RBIMPL_ATTR_COLD() __attribute__((__cold__))
33
+ #else
34
+ # define RBIMPL_ATTR_COLD() /* void */
35
+ #endif
36
+
37
+ #endif /* RBIMPL_ATTR_COLD_H */
@@ -0,0 +1,46 @@
1
+ #ifndef RBIMPL_ATTR_CONST_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_CONST_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 #RBIMPL_ATTR_CONST.
22
+ */
23
+ #include "ruby/internal/compiler_since.h"
24
+ #include "ruby/internal/has/attribute.h"
25
+ #include "ruby/internal/has/declspec_attribute.h"
26
+
27
+ /** Wraps (or simulates) `__attribute__((const))` */
28
+ #if RBIMPL_HAS_ATTRIBUTE(const)
29
+ # define RBIMPL_ATTR_CONST() __attribute__((__const__))
30
+ #elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noalias)
31
+ # /* If a function can be a const, that is also a noalias. */
32
+ # define RBIMPL_ATTR_CONST() __declspec(noalias)
33
+ #elif RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0)
34
+ # define RBIMPL_ATTR_CONST() _Pragma("no_side_effect")
35
+ #else
36
+ # define RBIMPL_ATTR_CONST() /* void */
37
+ #endif
38
+
39
+ /** Enables #RBIMPL_ATTR_CONST iff. #RUBY_NDEBUG. */
40
+ #if RUBY_NDEBUG
41
+ # define RBIMPL_ATTR_CONST_ON_NDEBUG() RBIMPL_ATTR_CONST()
42
+ #else
43
+ # define RBIMPL_ATTR_CONST_ON_NDEBUG() /* void */
44
+ #endif
45
+
46
+ #endif /* RBIMPL_ATTR_CONST_H */
@@ -0,0 +1,85 @@
1
+ #ifndef RBIMPL_ATTR_CONSTEXPR_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_CONSTEXPR_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 #RBIMPL_ATTR_CONSTEXPR.
22
+ */
23
+ #include "ruby/internal/has/feature.h"
24
+ #include "ruby/internal/compiler_is.h"
25
+ #include "ruby/internal/token_paste.h"
26
+
27
+ /** @cond INTERNAL_MACRO */
28
+ #if ! defined(__cplusplus)
29
+ # /* Makes no sense. */
30
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 0
31
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 0
32
+
33
+ #elif defined(__cpp_constexpr)
34
+ # /* https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations */
35
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 (__cpp_constexpr >= 200704L)
36
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 (__cpp_constexpr >= 201304L)
37
+
38
+ #elif RBIMPL_COMPILER_SINCE(MSVC, 19, 0, 0)
39
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 RBIMPL_COMPILER_SINCE(MSVC, 19, 00, 00)
40
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 RBIMPL_COMPILER_SINCE(MSVC, 19, 11, 00)
41
+
42
+ #elif RBIMPL_COMPILER_SINCE(SunPro, 5, 13, 0)
43
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 (__cplusplus >= 201103L)
44
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 (__cplusplus >= 201402L)
45
+
46
+ #elif RBIMPL_COMPILER_SINCE(GCC, 4, 9, 0)
47
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 (__cplusplus >= 201103L)
48
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 (__cplusplus >= 201402L)
49
+
50
+ #elif RBIMPL_HAS_FEATURE(cxx_relaxed_constexpr)
51
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 1
52
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 1
53
+
54
+ #elif RBIMPL_HAS_FEATURE(cxx_constexpr)
55
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 1
56
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 0
57
+
58
+ #else
59
+ # /* :FIXME: icpc must have constexpr but don't know how to detect. */
60
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX11 0
61
+ # define RBIMPL_HAS_ATTR_CONSTEXPR_CXX14 0
62
+ #endif
63
+ /** @endcond */
64
+
65
+ /** Wraps (or simulates) C++11 `constexpr`. */
66
+ #if RBIMPL_HAS_ATTR_CONSTEXPR_CXX14
67
+ # define RBIMPL_ATTR_CONSTEXPR(_) constexpr
68
+
69
+ #elif RBIMPL_HAS_ATTR_CONSTEXPR_CXX11
70
+ # define RBIMPL_ATTR_CONSTEXPR(_) RBIMPL_TOKEN_PASTE(RBIMPL_ATTR_CONSTEXPR_, _)
71
+ # define RBIMPL_ATTR_CONSTEXPR_CXX11 constexpr
72
+ # define RBIMPL_ATTR_CONSTEXPR_CXX14 /* void */
73
+
74
+ #else
75
+ # define RBIMPL_ATTR_CONSTEXPR(_) /* void */
76
+ #endif
77
+
78
+ /** Enables #RBIMPL_ATTR_CONSTEXPR iff. #RUBY_NDEBUG. */
79
+ #if RUBY_NDEBUG
80
+ # define RBIMPL_ATTR_CONSTEXPR_ON_NDEBUG(_) RBIMPL_ATTR_CONSTEXPR(_)
81
+ #else
82
+ # define RBIMPL_ATTR_CONSTEXPR_ON_NDEBUG(_) /* void */
83
+ #endif
84
+
85
+ #endif /* RBIMPL_ATTR_CONSTEXPR_H */
@@ -0,0 +1,59 @@
1
+ #ifndef RBIMPL_ATTR_DEPRECATED_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_DEPRECATED_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 #RBIMPL_ATTR_DEPRECATED.
22
+ */
23
+ #include "ruby/internal/compiler_since.h"
24
+ #include "ruby/internal/has/attribute.h"
25
+ #include "ruby/internal/has/c_attribute.h"
26
+ #include "ruby/internal/has/cpp_attribute.h"
27
+ #include "ruby/internal/has/declspec_attribute.h"
28
+ #include "ruby/internal/has/extension.h"
29
+
30
+ /** Wraps (or simulates) `[[deprecated]]` */
31
+ #if RBIMPL_HAS_EXTENSION(attribute_deprecated_with_message)
32
+ # define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg))
33
+
34
+ #elif RBIMPL_COMPILER_SINCE(GCC, 4, 5, 0)
35
+ # define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg))
36
+
37
+ #elif RBIMPL_COMPILER_SINCE(Intel, 13, 0, 0)
38
+ # define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg))
39
+
40
+ #elif RBIMPL_HAS_ATTRIBUTE(deprecated) /* but not with message. */
41
+ # define RBIMPL_ATTR_DEPRECATED(msg) __attribute__((__deprecated__))
42
+
43
+ #elif RBIMPL_COMPILER_SINCE(MSVC, 14, 0, 0)
44
+ # define RBIMPL_ATTR_DEPRECATED(msg) __declspec(deprecated msg)
45
+
46
+ #elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(deprecated)
47
+ # define RBIMPL_ATTR_DEPRECATED(msg) __declspec(deprecated)
48
+
49
+ #elif RBIMPL_HAS_CPP_ATTRIBUTE(deprecated)
50
+ # define RBIMPL_ATTR_DEPRECATED(msg) [[deprecated msg]]
51
+
52
+ #elif RBIMPL_HAS_C_ATTRIBUTE(deprecated)
53
+ # define RBIMPL_ATTR_DEPRECATED(msg) [[deprecated msg]]
54
+
55
+ #else
56
+ # define RBIMPL_ATTR_DEPRECATED(msg) /* void */
57
+ #endif
58
+
59
+ #endif /* RBIMPL_ATTR_DEPRECATED_H */
@@ -0,0 +1,42 @@
1
+ #ifndef RBIMPL_ATTR_DIAGNOSE_IF_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_DIAGNOSE_IF_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 #RBIMPL_ATTR_DIAGNOSE_IF.
22
+ */
23
+ #include "ruby/internal/has/attribute.h"
24
+ #include "ruby/internal/warning_push.h"
25
+
26
+ /** Wraps (or simulates) `__attribute__((diagnose_if))` */
27
+ #if RBIMPL_COMPILER_BEFORE(Clang, 5, 0, 0)
28
+ # /* https://bugs.llvm.org/show_bug.cgi?id=34319 */
29
+ # define RBIMPL_ATTR_DIAGNOSE_IF(_, __, ___) /* void */
30
+
31
+ #elif RBIMPL_HAS_ATTRIBUTE(diagnose_if)
32
+ # define RBIMPL_ATTR_DIAGNOSE_IF(_, __, ___) \
33
+ RBIMPL_WARNING_PUSH() \
34
+ RBIMPL_WARNING_IGNORED(-Wgcc-compat) \
35
+ __attribute__((__diagnose_if__(_, __, ___))) \
36
+ RBIMPL_WARNING_POP()
37
+
38
+ #else
39
+ # define RBIMPL_ATTR_DIAGNOSE_IF(_, __, ___) /* void */
40
+ #endif
41
+
42
+ #endif /* RBIMPL_ATTR_DIAGNOSE_IF_H */
@@ -0,0 +1,32 @@
1
+ #ifndef RBIMPL_ATTR_ENUM_EXTENSIBILITY_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_ENUM_EXTENSIBILITY_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 #RBIMPL_ATTR_ENUM_EXTENSIBILITY.
22
+ */
23
+ #include "ruby/internal/has/attribute.h"
24
+
25
+ /** Wraps (or simulates) `__attribute__((enum_extensibility))` */
26
+ #if RBIMPL_HAS_ATTRIBUTE(enum_extensibility)
27
+ # define RBIMPL_ATTR_ENUM_EXTENSIBILITY(_) __attribute__((__enum_extensibility__(_)))
28
+ #else
29
+ # define RBIMPL_ATTR_ENUM_EXTENSIBILITY(_) /* void */
30
+ #endif
31
+
32
+ #endif /* RBIMPL_ATTR_ENUM_EXTENSIBILITY_H */
@@ -0,0 +1,32 @@
1
+ #ifndef RBIMPL_ATTR_ERROR_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_ERROR_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 #RBIMPL_ATTR_ERROR.
22
+ */
23
+ #include "ruby/internal/has/attribute.h"
24
+
25
+ /** Wraps (or simulates) `__attribute__((error))` */
26
+ #if RBIMPL_HAS_ATTRIBUTE(error)
27
+ # define RBIMPL_ATTR_ERROR(msg) __attribute__((__error__ msg))
28
+ #else
29
+ # define RBIMPL_ATTR_ERROR(msg) /* void */
30
+ #endif
31
+
32
+ #endif /* RBIMPL_ATTR_ERROR_H */
@@ -0,0 +1,33 @@
1
+ #ifndef RBIMPL_ATTR_FLAG_ENUM_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_FLAG_ENUM_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 #RBIMPL_ATTR_FLAG_ENUM.
22
+ * @see https://clang.llvm.org/docs/AttributeReference.html#flag_enum
23
+ */
24
+ #include "ruby/internal/has/attribute.h"
25
+
26
+ /** Wraps (or simulates) `__attribute__((flag_enum)` */
27
+ #if RBIMPL_HAS_ATTRIBUTE(flag_enum)
28
+ # define RBIMPL_ATTR_FLAG_ENUM() __attribute__((__flag_enum__))
29
+ #else
30
+ # define RBIMPL_ATTR_FLAG_ENUM() /* void */
31
+ #endif
32
+
33
+ #endif /* RBIMPLATTR_FLAG_ENUM_H */