zscan 2.0.8 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
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,45 @@
1
+ #ifndef RBIMPL_ATTR_RESTRICT_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_RESTRICT_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_RESTRICT.
22
+ */
23
+ #include "ruby/internal/compiler_since.h"
24
+ #include "ruby/internal/has/attribute.h"
25
+ #include "ruby/internal/token_paste.h"
26
+
27
+ /* :FIXME: config.h includes conflicting `#define restrict`. MSVC can be
28
+ * detected using `RBIMPL_COMPILER_SINCE()`, but Clang & family cannot use
29
+ * `__has_declspec_attribute()` which involves macro substitution. */
30
+
31
+ /** Wraps (or simulates) `__declspec(restrict)` */
32
+ #if RBIMPL_COMPILER_SINCE(MSVC, 14, 0, 0)
33
+ # define RBIMPL_ATTR_RESTRICT() __declspec(RBIMPL_TOKEN_PASTE(re, strict))
34
+
35
+ #elif RBIMPL_HAS_ATTRIBUTE(malloc)
36
+ # define RBIMPL_ATTR_RESTRICT() __attribute__((__malloc__))
37
+
38
+ #elif RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0)
39
+ # define RBIMPL_ATTR_RESTRICT() _Pragma("returns_new_memory")
40
+
41
+ #else
42
+ # define RBIMPL_ATTR_RESTRICT() /* void */
43
+ #endif
44
+
45
+ #endif /* RBIMPL_ATTR_RESTRICT_H */
@@ -0,0 +1,37 @@
1
+ #ifndef RBIMPL_ATTR_RETURNS_NONNULL_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_RETURNS_NONNULL_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_RETURNS_NONNULL.
22
+ */
23
+ #include "ruby/internal/has/attribute.h"
24
+
25
+ /** Wraps (or simulates) `__attribute__((returns_nonnull))` */
26
+ #if defined(_Ret_nonnull_)
27
+ # /* Take SAL definition. */
28
+ # define RBIMPL_ATTR_RETURNS_NONNULL() _Ret_nonnull_
29
+
30
+ #elif RBIMPL_HAS_ATTRIBUTE(returns_nonnull)
31
+ # define RBIMPL_ATTR_RETURNS_NONNULL() __attribute__((__returns_nonnull__))
32
+
33
+ #else
34
+ # define RBIMPL_ATTR_RETURNS_NONNULL() /* void */
35
+ #endif
36
+
37
+ #endif /* RBIMPL_ATTR_RETURNS_NONNULL_H */
@@ -0,0 +1,32 @@
1
+ #ifndef RBIMPL_ATTR_WARNING_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_WARNING_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_WARNING.
22
+ */
23
+ #include "ruby/internal/has/attribute.h"
24
+
25
+ /** Wraps (or simulates) `__attribute__((warning))` */
26
+ #if RBIMPL_HAS_ATTRIBUTE(warning)
27
+ # define RBIMPL_ATTR_WARNING(msg) __attribute__((__warning__ msg))
28
+ #else
29
+ # define RBIMPL_ATTR_WARNING(msg) /* void */
30
+ #endif
31
+
32
+ #endif /* RBIMPL_ATTR_WARNING_H */
@@ -0,0 +1,32 @@
1
+ #ifndef RBIMPL_ATTR_WEAKREF_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_ATTR_WEAKREF_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_WEAKREF.
22
+ */
23
+ #include "ruby/internal/has/attribute.h"
24
+
25
+ /** Wraps (or simulates) `__attribute__((weakref))` */
26
+ #if RBIMPL_HAS_ATTRIBUTE(weakref)
27
+ # define RBIMPL_ATTR_WEAKREF(sym) __attribute__((__weakref__(# sym)))
28
+ #else
29
+ # define RBIMPL_ATTR_WEAKREF(sym) /* void */
30
+ #endif
31
+
32
+ #endif /* RBIMPL_ATTR_WEAKREF_H */
@@ -0,0 +1,53 @@
1
+ #ifndef RBIMPL_CAST_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_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 RBIMPL_CAST.
22
+ * @cond INTERNAL_MACRO
23
+ *
24
+ * This casting macro makes sense only inside of other macros that are part of
25
+ * public headers. They could be used from C++, and C-style casts could issue
26
+ * warnings. Ruby internals are pure C so they should not bother.
27
+ */
28
+ #include "ruby/internal/compiler_since.h"
29
+ #include "ruby/internal/has/warning.h"
30
+ #include "ruby/internal/warning_push.h"
31
+
32
+ #if ! defined(__cplusplus)
33
+ # define RBIMPL_CAST(expr) (expr)
34
+
35
+ #elif RBIMPL_COMPILER_SINCE(GCC, 4, 6, 0)
36
+ # /* g++ has -Wold-style-cast since 1997 or so, but its _Pragma is broken. */
37
+ # /* See https://gcc.godbolt.org/z/XWhU6J */
38
+ # define RBIMPL_CAST(expr) (expr)
39
+ # pragma GCC diagnostic ignored "-Wold-style-cast"
40
+
41
+ #elif RBIMPL_HAS_WARNING("-Wold-style-cast")
42
+ # define RBIMPL_CAST(expr) \
43
+ RBIMPL_WARNING_PUSH() \
44
+ RBIMPL_WARNING_IGNORED(-Wold-style-cast) \
45
+ (expr) \
46
+ RBIMPL_WARNING_POP()
47
+
48
+ #else
49
+ # define RBIMPL_CAST(expr) (expr)
50
+ #endif
51
+ /** @endcond */
52
+
53
+ #endif /* RBIMPL_CAST_H */
@@ -0,0 +1,45 @@
1
+ #ifndef RBIMPL_COMPILER_IS_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_COMPILER_IS_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_COMPILER_IS.
22
+ */
23
+
24
+ /**
25
+ * @brief Checks if the compiler is of given brand.
26
+ * @param cc Compiler brand, like `MSVC`.
27
+ * @retval true It is.
28
+ * @retval false It isn't.
29
+ */
30
+ #define RBIMPL_COMPILER_IS(cc) RBIMPL_COMPILER_IS_ ## cc
31
+
32
+ #include "ruby/internal/compiler_is/apple.h"
33
+ #include "ruby/internal/compiler_is/clang.h"
34
+ #include "ruby/internal/compiler_is/gcc.h"
35
+ #include "ruby/internal/compiler_is/intel.h"
36
+ #include "ruby/internal/compiler_is/msvc.h"
37
+ #include "ruby/internal/compiler_is/sunpro.h"
38
+ /* :TODO: Other possible compilers to support:
39
+ *
40
+ * - IBM XL: recent XL are clang-backended so some tweaks like we do for
41
+ * Apple's might be needed.
42
+ *
43
+ * - ARM's armclang: ditto, it can be clang-backended. */
44
+
45
+ #endif /* RBIMPL_COMPILER_IS_H */
@@ -0,0 +1,41 @@
1
+ #ifndef RBIMPL_COMPILER_IS_APPLE_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_COMPILER_IS_APPLE_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_COMPILER_IS_Apple.
22
+ *
23
+ * Apple ships clang. Problem is, its `__clang_major__` etc. are not the
24
+ * upstream LLVM version, but XCode's. We have to think Apple's is distinct
25
+ * from LLVM's, when it comes to compiler detection business in this header
26
+ * file.
27
+ */
28
+ #if ! defined(__clang__)
29
+ # define RBIMPL_COMPILER_IS_Apple 0
30
+
31
+ #elif ! defined(__apple_build_version__)
32
+ # define RBIMPL_COMPILER_IS_Apple 0
33
+
34
+ #else
35
+ # define RBIMPL_COMPILER_IS_Apple 1
36
+ # define RBIMPL_COMPILER_VERSION_MAJOR __clang_major__
37
+ # define RBIMPL_COMPILER_VERSION_MINOR __clang_minor__
38
+ # define RBIMPL_COMPILER_VERSION_PATCH __clang_patchlevel__
39
+ #endif
40
+
41
+ #endif /* RBIMPL_COMPILER_IS_APPLE_H */
@@ -0,0 +1,38 @@
1
+ #ifndef RBIMPL_COMPILER_IS_CLANG_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_COMPILER_IS_CLANG_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_COMPILER_IS_Clang.
22
+ */
23
+ #include "ruby/internal/compiler_is/apple.h"
24
+
25
+ #if ! defined(__clang__)
26
+ # define RBIMPL_COMPILER_IS_Clang 0
27
+
28
+ #elif RBIMPL_COMPILER_IS(Apple)
29
+ # define RBIMPL_COMPILER_IS_Clang 0
30
+
31
+ #else
32
+ # define RBIMPL_COMPILER_IS_Clang 1
33
+ # define RBIMPL_COMPILER_VERSION_MAJOR __clang_major__
34
+ # define RBIMPL_COMPILER_VERSION_MINOR __clang_minor__
35
+ # define RBIMPL_COMPILER_VERSION_PATCH __clang_patchlevel__
36
+ #endif
37
+
38
+ #endif /* RBIMPL_COMPILER_IS_CLANG_H */
@@ -0,0 +1,46 @@
1
+ #ifndef RBIMPL_COMPILER_IS_GCC_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_COMPILER_IS_GCC_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_COMPILER_IS_GCC.
22
+ */
23
+ #include "ruby/internal/compiler_is/apple.h"
24
+ #include "ruby/internal/compiler_is/clang.h"
25
+ #include "ruby/internal/compiler_is/intel.h"
26
+
27
+ #if ! defined(__GNUC__)
28
+ # define RBIMPL_COMPILER_IS_GCC 0
29
+
30
+ #elif RBIMPL_COMPILER_IS(Apple)
31
+ # define RBIMPL_COMPILER_IS_GCC 0
32
+
33
+ #elif RBIMPL_COMPILER_IS(Clang)
34
+ # define RBIMPL_COMPILER_IS_GCC 0
35
+
36
+ #elif RBIMPL_COMPILER_IS(Intel)
37
+ # define RBIMPL_COMPILER_IS_GCC 0
38
+
39
+ #else
40
+ # define RBIMPL_COMPILER_IS_GCC 1
41
+ # define RBIMPL_COMPILER_VERSION_MAJOR __GNUC__
42
+ # define RBIMPL_COMPILER_VERSION_MINOR __GNUC_MINOR__
43
+ # define RBIMPL_COMPILER_VERSION_PATCH __GNUC_PATCHLEVEL__
44
+ #endif
45
+
46
+ #endif /* RBIMPL_COMPILER_IS_GCC_H */
@@ -0,0 +1,41 @@
1
+ #ifndef RBIMPL_COMPILER_IS_INTEL_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_COMPILER_IS_INTEL_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_COMPILER_IS_Intel.
22
+ */
23
+ #if ! defined(__INTEL_COMPILER)
24
+ # define RBIMPL_COMPILER_IS_Intel 0
25
+
26
+ #elif ! defined(__INTEL_COMPILER_UPDATE)
27
+ # define RBIMPL_COMPILER_IS_Intel 1
28
+ # /* __INTEL_COMPILER = XXYZ */
29
+ # define RBIMPL_COMPILER_VERSION_MAJOR (__INTEL_COMPILER / 100)
30
+ # define RBIMPL_COMPILER_VERSION_MINOR (__INTEL_COMPILER % 100 / 10)
31
+ # define RBIMPL_COMPILER_VERSION_PATCH (__INTEL_COMPILER % 10)
32
+
33
+ #else
34
+ # define RBIMPL_COMPILER_IS_Intel 1
35
+ # /* __INTEL_COMPILER = XXYZ */
36
+ # define RBIMPL_COMPILER_VERSION_MAJOR (__INTEL_COMPILER / 100)
37
+ # define RBIMPL_COMPILER_VERSION_MINOR (__INTEL_COMPILER % 100 / 10)
38
+ # define RBIMPL_COMPILER_VERSION_PATCH __INTEL_COMPILER_UPDATE
39
+ #endif
40
+
41
+ #endif /* RBIMPL_COMPILER_IS_INTEL_H */
@@ -0,0 +1,57 @@
1
+ #ifndef RBIMPL_COMPILER_IS_MSVC_H /*-*-C++-*-vi:se ft=cpp:*/
2
+ #define RBIMPL_COMPILER_IS_MSVC_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_COMPILER_IS_MSVC.
22
+ */
23
+ #include "ruby/internal/compiler_is/clang.h"
24
+ #include "ruby/internal/compiler_is/intel.h"
25
+
26
+ #if ! defined(_MSC_VER)
27
+ # define RBIMPL_COMPILER_IS_MSVC 0
28
+
29
+ #elif RBIMPL_COMPILER_IS(Clang)
30
+ # define RBIMPL_COMPILER_IS_MSVC 0
31
+
32
+ #elif RBIMPL_COMPILER_IS(Intel)
33
+ # define RBIMPL_COMPILER_IS_MSVC 0
34
+
35
+ #elif _MSC_VER >= 1400
36
+ # define RBIMPL_COMPILER_IS_MSVC 1
37
+ # /* _MSC_FULL_VER = XXYYZZZZZ */
38
+ # define RBIMPL_COMPILER_VERSION_MAJOR (_MSC_FULL_VER / 10000000)
39
+ # define RBIMPL_COMPILER_VERSION_MINOR (_MSC_FULL_VER % 10000000 / 100000)
40
+ # define RBIMPL_COMPILER_VERSION_PATCH (_MSC_FULL_VER % 100000)
41
+
42
+ #elif defined(_MSC_FULL_VER)
43
+ # define RBIMPL_COMPILER_IS_MSVC 1
44
+ # /* _MSC_FULL_VER = XXYYZZZZ */
45
+ # define RBIMPL_COMPILER_VERSION_MAJOR (_MSC_FULL_VER / 1000000)
46
+ # define RBIMPL_COMPILER_VERSION_MINOR (_MSC_FULL_VER % 1000000 / 10000)
47
+ # define RBIMPL_COMPILER_VERSION_PATCH (_MSC_FULL_VER % 10000)
48
+
49
+ #else
50
+ # define RBIMPL_COMPILER_IS_MSVC 1
51
+ # /* _MSC_VER = XXYY */
52
+ # define RBIMPL_COMPILER_VERSION_MAJOR (_MSC_VER / 100)
53
+ # define RBIMPL_COMPILER_VERSION_MINOR (_MSC_VER % 100)
54
+ # define RBIMPL_COMPILER_VERSION_PATCH 0
55
+ #endif
56
+
57
+ #endif /* RBIMPL_COMPILER_IS_MSVC_H */