zscan 2.0.8 → 2.0.9
Sign up to get free protection for your applications and to get access to all the features.
- 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,38 @@
|
|
1
|
+
#ifndef RBIMPL_HAS_C_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
|
2
|
+
#define RBIMPL_HAS_C_ATTRIBUTE_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_HAS_C_ATTRIBUTE.
|
22
|
+
*/
|
23
|
+
|
24
|
+
/** Wraps (or simulates) `__has_c_attribute`. */
|
25
|
+
#if defined(__cplusplus)
|
26
|
+
# /* Makes no sense. */
|
27
|
+
# define RBIMPL_HAS_C_ATTRIBUTE(_) 0
|
28
|
+
|
29
|
+
#elif defined(__has_c_attribute)
|
30
|
+
# define RBIMPL_HAS_C_ATTRIBUTE(_) __has_c_attribute(_)
|
31
|
+
|
32
|
+
#else
|
33
|
+
# /* As of writing everything that lacks __has_c_attribute also completely
|
34
|
+
# * lacks C2x attributes as well. Might change in future? */
|
35
|
+
# define RBIMPL_HAS_C_ATTRIBUTE(_) 0
|
36
|
+
#endif
|
37
|
+
|
38
|
+
#endif /* RBIMPL_HAS_C_ATTRIBUTE_H */
|
@@ -0,0 +1,79 @@
|
|
1
|
+
#ifndef RBIMPL_HAS_CPP_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
|
2
|
+
#define RBIMPL_HAS_CPP_ATTRIBUTE_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_HAS_CPP_ATTRIBUTE.
|
22
|
+
*/
|
23
|
+
#include "ruby/internal/compiler_is.h"
|
24
|
+
#include "ruby/internal/compiler_since.h"
|
25
|
+
#include "ruby/internal/token_paste.h"
|
26
|
+
|
27
|
+
/** @cond INTERNAL_MACRO */
|
28
|
+
#if defined(__has_cpp_attribute)
|
29
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE0(_) __has_cpp_attribute(_)
|
30
|
+
|
31
|
+
#elif RBIMPL_COMPILER_IS(MSVC)
|
32
|
+
# /* MSVC has never updated its __cplusplus since forever (unless specified
|
33
|
+
# * explicitly by a compiler flag). They also lack __has_cpp_attribute until
|
34
|
+
# * 2019. However, they do have attributes since 2015 or so. */
|
35
|
+
# /* https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance */
|
36
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE0(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_CPP_ATTRIBUTE_, _)
|
37
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE_noreturn 200809 * RBIMPL_COMPILER_SINCE(MSVC, 19, 00, 0)
|
38
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE_carries_dependency 200809 * RBIMPL_COMPILER_SINCE(MSVC, 19, 00, 0)
|
39
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE_deprecated 201309 * RBIMPL_COMPILER_SINCE(MSVC, 19, 10, 0)
|
40
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE_fallthrough 201603 * RBIMPL_COMPILER_SINCE(MSVC, 19, 10, 0)
|
41
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE_maybe_unused 201603 * RBIMPL_COMPILER_SINCE(MSVC, 19, 11, 0)
|
42
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE_nodiscard 201603 * RBIMPL_COMPILER_SINCE(MSVC, 19, 11, 0)
|
43
|
+
|
44
|
+
#elif RBIMPL_COMPILER_BEFORE(Clang, 3, 6, 0)
|
45
|
+
# /* Clang 3.6.0 introduced __has_cpp_attribute. Prior to that following
|
46
|
+
# * attributes were already there. */
|
47
|
+
# /* https://clang.llvm.org/cxx_status.html */
|
48
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE0(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_CPP_ATTRIBUTE_, _)
|
49
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE_noreturn 200809 * RBIMPL_COMPILER_SINCE(Clang, 3, 3, 0)
|
50
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE_deprecated 201309 * RBIMPL_COMPILER_SINCE(Clang, 3, 4, 0)
|
51
|
+
|
52
|
+
#elif RBIMPL_COMPILER_BEFORE(GCC, 5, 0, 0)
|
53
|
+
# /* GCC 5+ have __has_cpp_attribute, while 4.x had following attributes. */
|
54
|
+
# /* https://gcc.gnu.org/projects/cxx-status.html */
|
55
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE0(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_CPP_ATTRIBUTE_, _)
|
56
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE_noreturn 200809 * RBIMPL_COMPILER_SINCE(GCC, 4, 8, 0)
|
57
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE_deprecated 201309 * RBIMPL_COMPILER_SINCE(GCC, 4, 9, 0)
|
58
|
+
|
59
|
+
#else
|
60
|
+
# /* :FIXME:
|
61
|
+
# * Candidate compilers to list here:
|
62
|
+
# * - icpc: They have __INTEL_CXX11_MODE__.
|
63
|
+
# * - SunPro: Seems they support C++11.
|
64
|
+
# */
|
65
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE0(_) 0
|
66
|
+
#endif
|
67
|
+
/** @endcond */
|
68
|
+
|
69
|
+
/** Wraps (or simulates) `__has_cpp_attribute`. */
|
70
|
+
#if ! defined(__cplusplus)
|
71
|
+
# /* Makes no sense. */
|
72
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE(_) 0
|
73
|
+
#else
|
74
|
+
# /* GCC needs workarounds. See https://gcc.godbolt.org/z/jdz3pa */
|
75
|
+
# define RBIMPL_HAS_CPP_ATTRIBUTE(_) \
|
76
|
+
((RBIMPL_HAS_CPP_ATTRIBUTE0(_) <= __cplusplus) ? RBIMPL_HAS_CPP_ATTRIBUTE0(_) : 0)
|
77
|
+
#endif
|
78
|
+
|
79
|
+
#endif /* RBIMPL_HAS_CPP_ATTRIBUTE_H */
|
@@ -0,0 +1,48 @@
|
|
1
|
+
#ifndef RBIMPL_HAS_DECLSPEC_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
|
2
|
+
#define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_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_HAS_DECLSPEC_ATTRIBUTE.
|
22
|
+
*/
|
23
|
+
#include "ruby/internal/compiler_since.h"
|
24
|
+
#include "ruby/internal/token_paste.h"
|
25
|
+
|
26
|
+
/** Wraps (or simulates) `__has_declspec_attribute`. */
|
27
|
+
#if defined(__has_declspec_attribute)
|
28
|
+
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE(_) __has_declspec_attribute(_)
|
29
|
+
#else
|
30
|
+
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_DECLSPEC_ATTRIBUTE_, _)
|
31
|
+
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_align RBIMPL_COMPILER_SINCE(MSVC, 8, 0, 0)
|
32
|
+
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_deprecated RBIMPL_COMPILER_SINCE(MSVC,13, 0, 0)
|
33
|
+
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_dllexport RBIMPL_COMPILER_SINCE(MSVC, 8, 0, 0)
|
34
|
+
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_dllimport RBIMPL_COMPILER_SINCE(MSVC, 8, 0, 0)
|
35
|
+
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_empty_bases RBIMPL_COMPILER_SINCE(MSVC,19, 0, 23918)
|
36
|
+
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_noalias RBIMPL_COMPILER_SINCE(MSVC, 8, 0, 0)
|
37
|
+
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_noinline RBIMPL_COMPILER_SINCE(MSVC,13, 0, 0)
|
38
|
+
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_noreturn RBIMPL_COMPILER_SINCE(MSVC,11, 0, 0)
|
39
|
+
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_nothrow RBIMPL_COMPILER_SINCE(MSVC, 8, 0, 0)
|
40
|
+
# define RBIMPL_HAS_DECLSPEC_ATTRIBUTE_restrict RBIMPL_COMPILER_SINCE(MSVC,14, 0, 0)
|
41
|
+
# /* Note that "8, 0, 0" might be inaccurate. */
|
42
|
+
# if ! defined(__cplusplus)
|
43
|
+
# /* Clang has this in both C/C++, but MSVC has this in C++ only.*/
|
44
|
+
# undef RBIMPL_HAS_DECLSPEC_ATTRIBUTE_nothrow
|
45
|
+
# endif
|
46
|
+
#endif
|
47
|
+
|
48
|
+
#endif /* RBIMPL_HAS_DECLSPEC_ATTRIBUTE_H */
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#ifndef RBIMPL_HAS_EXTENSION_H /*-*-C++-*-vi:se ft=cpp:*/
|
2
|
+
#define RBIMPL_HAS_EXTENSION_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_HAS_EXTENSION.
|
22
|
+
*/
|
23
|
+
#include "ruby/internal/has/feature.h"
|
24
|
+
|
25
|
+
/** Wraps (or simulates) `__has_extension`. */
|
26
|
+
#if defined(__has_extension)
|
27
|
+
# define RBIMPL_HAS_EXTENSION(_) __has_extension(_)
|
28
|
+
#else
|
29
|
+
# /* Pre-3.0 clang had __has_feature but not __has_extension. */
|
30
|
+
# define RBIMPL_HAS_EXTENSION(_) RBIMPL_HAS_FEATURE(_)
|
31
|
+
#endif
|
32
|
+
|
33
|
+
#endif /* RBIMPL_HAS_EXTENSION_H */
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#ifndef RBIMPL_HAS_FEATURE_H /*-*-C++-*-vi:se ft=cpp:*/
|
2
|
+
#define RBIMPL_HAS_FEATURE_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_HAS_FEATURE.
|
22
|
+
*/
|
23
|
+
|
24
|
+
/** Wraps (or simulates) `__has_feature`. */
|
25
|
+
#if defined(__has_feature)
|
26
|
+
# define RBIMPL_HAS_FEATURE(_) __has_feature(_)
|
27
|
+
#else
|
28
|
+
# define RBIMPL_HAS_FEATURE(_) 0
|
29
|
+
#endif
|
30
|
+
|
31
|
+
#endif /* RBIMPL_HAS_FEATURE_H */
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#ifndef RBIMPL_HAS_WARNING_H /*-*-C++-*-vi:se ft=cpp:*/
|
2
|
+
#define RBIMPL_HAS_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_HAS_WARNING.
|
22
|
+
*/
|
23
|
+
|
24
|
+
/** Wraps (or simulates) `__has_warning`. */
|
25
|
+
#if defined(__has_warning)
|
26
|
+
# define RBIMPL_HAS_WARNING(_) __has_warning(_)
|
27
|
+
#else
|
28
|
+
# define RBIMPL_HAS_WARNING(_) 0
|
29
|
+
#endif
|
30
|
+
|
31
|
+
#endif /* RBIMPL_HAS_WARNING_H */
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#ifndef RBIMPL_INTERN_ARRAY_H /*-*-C++-*-vi:se ft=cpp:*/
|
2
|
+
#define RBIMPL_INTERN_ARRAY_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 Public APIs related to ::rb_cArray.
|
22
|
+
*/
|
23
|
+
#include "ruby/internal/dllexport.h"
|
24
|
+
#include "ruby/internal/value.h"
|
25
|
+
|
26
|
+
RBIMPL_SYMBOL_EXPORT_BEGIN()
|
27
|
+
|
28
|
+
/* array.c */
|
29
|
+
void rb_mem_clear(VALUE*, long);
|
30
|
+
VALUE rb_assoc_new(VALUE, VALUE);
|
31
|
+
VALUE rb_check_array_type(VALUE);
|
32
|
+
VALUE rb_ary_new(void);
|
33
|
+
VALUE rb_ary_new_capa(long capa);
|
34
|
+
VALUE rb_ary_new_from_args(long n, ...);
|
35
|
+
VALUE rb_ary_new_from_values(long n, const VALUE *elts);
|
36
|
+
VALUE rb_ary_tmp_new(long);
|
37
|
+
void rb_ary_free(VALUE);
|
38
|
+
void rb_ary_modify(VALUE);
|
39
|
+
VALUE rb_ary_freeze(VALUE);
|
40
|
+
VALUE rb_ary_shared_with_p(VALUE, VALUE);
|
41
|
+
VALUE rb_ary_aref(int, const VALUE*, VALUE);
|
42
|
+
VALUE rb_ary_subseq(VALUE, long, long);
|
43
|
+
void rb_ary_store(VALUE, long, VALUE);
|
44
|
+
VALUE rb_ary_dup(VALUE);
|
45
|
+
VALUE rb_ary_resurrect(VALUE ary);
|
46
|
+
VALUE rb_ary_to_ary(VALUE);
|
47
|
+
VALUE rb_ary_to_s(VALUE);
|
48
|
+
VALUE rb_ary_cat(VALUE, const VALUE *, long);
|
49
|
+
VALUE rb_ary_push(VALUE, VALUE);
|
50
|
+
VALUE rb_ary_pop(VALUE);
|
51
|
+
VALUE rb_ary_shift(VALUE);
|
52
|
+
VALUE rb_ary_unshift(VALUE, VALUE);
|
53
|
+
VALUE rb_ary_entry(VALUE, long);
|
54
|
+
VALUE rb_ary_each(VALUE);
|
55
|
+
VALUE rb_ary_join(VALUE, VALUE);
|
56
|
+
VALUE rb_ary_reverse(VALUE);
|
57
|
+
VALUE rb_ary_rotate(VALUE, long);
|
58
|
+
VALUE rb_ary_sort(VALUE);
|
59
|
+
VALUE rb_ary_sort_bang(VALUE);
|
60
|
+
VALUE rb_ary_delete(VALUE, VALUE);
|
61
|
+
VALUE rb_ary_delete_at(VALUE, long);
|
62
|
+
VALUE rb_ary_clear(VALUE);
|
63
|
+
VALUE rb_ary_plus(VALUE, VALUE);
|
64
|
+
VALUE rb_ary_concat(VALUE, VALUE);
|
65
|
+
VALUE rb_ary_assoc(VALUE, VALUE);
|
66
|
+
VALUE rb_ary_rassoc(VALUE, VALUE);
|
67
|
+
VALUE rb_ary_includes(VALUE, VALUE);
|
68
|
+
VALUE rb_ary_cmp(VALUE, VALUE);
|
69
|
+
VALUE rb_ary_replace(VALUE copy, VALUE orig);
|
70
|
+
VALUE rb_get_values_at(VALUE, long, int, const VALUE*, VALUE(*)(VALUE,long));
|
71
|
+
VALUE rb_ary_resize(VALUE ary, long len);
|
72
|
+
#define rb_ary_new2 rb_ary_new_capa
|
73
|
+
#define rb_ary_new3 rb_ary_new_from_args
|
74
|
+
#define rb_ary_new4 rb_ary_new_from_values
|
75
|
+
|
76
|
+
RBIMPL_SYMBOL_EXPORT_END()
|
77
|
+
|
78
|
+
#endif /* RBIMPL_INTERN_ARRAY_H */
|
@@ -0,0 +1,105 @@
|
|
1
|
+
#ifndef RBIMPL_INTERN_BIGNUM_H /*-*-C++-*-vi:se ft=cpp:*/
|
2
|
+
#define RBIMPL_INTERN_BIGNUM_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 Public APIs related to so-called rb_cBignum.
|
22
|
+
*/
|
23
|
+
#include "ruby/internal/config.h"
|
24
|
+
|
25
|
+
#ifdef STDC_HEADERS
|
26
|
+
# include <stddef.h>
|
27
|
+
#endif
|
28
|
+
|
29
|
+
#include "ruby/internal/dllexport.h"
|
30
|
+
#include "ruby/internal/value.h"
|
31
|
+
#include "ruby/backward/2/long_long.h"
|
32
|
+
|
33
|
+
RBIMPL_SYMBOL_EXPORT_BEGIN()
|
34
|
+
|
35
|
+
/* bignum.c */
|
36
|
+
VALUE rb_big_new(size_t, int);
|
37
|
+
int rb_bigzero_p(VALUE x);
|
38
|
+
VALUE rb_big_clone(VALUE);
|
39
|
+
void rb_big_2comp(VALUE);
|
40
|
+
VALUE rb_big_norm(VALUE);
|
41
|
+
void rb_big_resize(VALUE big, size_t len);
|
42
|
+
VALUE rb_cstr_to_inum(const char*, int, int);
|
43
|
+
VALUE rb_str_to_inum(VALUE, int, int);
|
44
|
+
VALUE rb_cstr2inum(const char*, int);
|
45
|
+
VALUE rb_str2inum(VALUE, int);
|
46
|
+
VALUE rb_big2str(VALUE, int);
|
47
|
+
long rb_big2long(VALUE);
|
48
|
+
#define rb_big2int(x) rb_big2long(x)
|
49
|
+
unsigned long rb_big2ulong(VALUE);
|
50
|
+
#define rb_big2uint(x) rb_big2ulong(x)
|
51
|
+
#if HAVE_LONG_LONG
|
52
|
+
LONG_LONG rb_big2ll(VALUE);
|
53
|
+
unsigned LONG_LONG rb_big2ull(VALUE);
|
54
|
+
#endif /* HAVE_LONG_LONG */
|
55
|
+
void rb_big_pack(VALUE val, unsigned long *buf, long num_longs);
|
56
|
+
VALUE rb_big_unpack(unsigned long *buf, long num_longs);
|
57
|
+
int rb_uv_to_utf8(char[6],unsigned long);
|
58
|
+
VALUE rb_dbl2big(double);
|
59
|
+
double rb_big2dbl(VALUE);
|
60
|
+
VALUE rb_big_cmp(VALUE, VALUE);
|
61
|
+
VALUE rb_big_eq(VALUE, VALUE);
|
62
|
+
VALUE rb_big_eql(VALUE, VALUE);
|
63
|
+
VALUE rb_big_plus(VALUE, VALUE);
|
64
|
+
VALUE rb_big_minus(VALUE, VALUE);
|
65
|
+
VALUE rb_big_mul(VALUE, VALUE);
|
66
|
+
VALUE rb_big_div(VALUE, VALUE);
|
67
|
+
VALUE rb_big_idiv(VALUE, VALUE);
|
68
|
+
VALUE rb_big_modulo(VALUE, VALUE);
|
69
|
+
VALUE rb_big_divmod(VALUE, VALUE);
|
70
|
+
VALUE rb_big_pow(VALUE, VALUE);
|
71
|
+
VALUE rb_big_and(VALUE, VALUE);
|
72
|
+
VALUE rb_big_or(VALUE, VALUE);
|
73
|
+
VALUE rb_big_xor(VALUE, VALUE);
|
74
|
+
VALUE rb_big_lshift(VALUE, VALUE);
|
75
|
+
VALUE rb_big_rshift(VALUE, VALUE);
|
76
|
+
|
77
|
+
/* For rb_integer_pack and rb_integer_unpack: */
|
78
|
+
/* "MS" in MSWORD and MSBYTE means "most significant" */
|
79
|
+
/* "LS" in LSWORD and LSBYTE means "least significant" */
|
80
|
+
#define INTEGER_PACK_MSWORD_FIRST 0x01
|
81
|
+
#define INTEGER_PACK_LSWORD_FIRST 0x02
|
82
|
+
#define INTEGER_PACK_MSBYTE_FIRST 0x10
|
83
|
+
#define INTEGER_PACK_LSBYTE_FIRST 0x20
|
84
|
+
#define INTEGER_PACK_NATIVE_BYTE_ORDER 0x40
|
85
|
+
#define INTEGER_PACK_2COMP 0x80
|
86
|
+
#define INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION 0x400
|
87
|
+
/* For rb_integer_unpack: */
|
88
|
+
#define INTEGER_PACK_FORCE_BIGNUM 0x100
|
89
|
+
#define INTEGER_PACK_NEGATIVE 0x200
|
90
|
+
/* Combinations: */
|
91
|
+
#define INTEGER_PACK_LITTLE_ENDIAN \
|
92
|
+
(INTEGER_PACK_LSWORD_FIRST | \
|
93
|
+
INTEGER_PACK_LSBYTE_FIRST)
|
94
|
+
#define INTEGER_PACK_BIG_ENDIAN \
|
95
|
+
(INTEGER_PACK_MSWORD_FIRST | \
|
96
|
+
INTEGER_PACK_MSBYTE_FIRST)
|
97
|
+
int rb_integer_pack(VALUE val, void *words, size_t numwords, size_t wordsize, size_t nails, int flags);
|
98
|
+
VALUE rb_integer_unpack(const void *words, size_t numwords, size_t wordsize, size_t nails, int flags);
|
99
|
+
size_t rb_absint_size(VALUE val, int *nlz_bits_ret);
|
100
|
+
size_t rb_absint_numwords(VALUE val, size_t word_numbits, size_t *nlz_bits_ret);
|
101
|
+
int rb_absint_singlebit_p(VALUE val);
|
102
|
+
|
103
|
+
RBIMPL_SYMBOL_EXPORT_END()
|
104
|
+
|
105
|
+
#endif /* RBIMPL_INTERN_BIGNUM_H */
|