zscan 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/pack/pack-27.c +1 -0
- data/ext/pack/pack.c +1 -0
- data/ext/pack/ruby/backward/2/assume.h +43 -0
- data/ext/pack/ruby/backward/2/attributes.h +157 -0
- data/ext/pack/ruby/backward/2/bool.h +37 -0
- data/ext/pack/ruby/backward/2/extern.h +46 -0
- data/ext/pack/ruby/backward/2/gcc_version_since.h +38 -0
- data/ext/pack/ruby/backward/2/inttypes.h +132 -0
- data/ext/pack/ruby/backward/2/limits.h +100 -0
- data/ext/pack/ruby/backward/2/long_long.h +65 -0
- data/ext/pack/ruby/backward/2/r_cast.h +27 -0
- data/ext/pack/ruby/backward/2/rmodule.h +31 -0
- data/ext/pack/ruby/backward/2/stdalign.h +30 -0
- data/ext/pack/ruby/backward/2/stdarg.h +47 -0
- data/ext/pack/ruby/backward/classext.h +25 -0
- data/ext/pack/ruby/backward/rubyio.h +18 -0
- data/ext/pack/ruby/backward/rubysig.h +26 -0
- data/ext/pack/ruby/backward/st.h +18 -0
- data/ext/pack/ruby/backward/util.h +18 -0
- data/ext/pack/ruby/internal/anyargs.h +375 -0
- data/ext/pack/ruby/internal/arithmetic.h +38 -0
- data/ext/pack/ruby/internal/arithmetic/char.h +58 -0
- data/ext/pack/ruby/internal/arithmetic/double.h +39 -0
- data/ext/pack/ruby/internal/arithmetic/fixnum.h +44 -0
- data/ext/pack/ruby/internal/arithmetic/gid_t.h +34 -0
- data/ext/pack/ruby/internal/arithmetic/int.h +163 -0
- data/ext/pack/ruby/internal/arithmetic/intptr_t.h +42 -0
- data/ext/pack/ruby/internal/arithmetic/long.h +244 -0
- data/ext/pack/ruby/internal/arithmetic/long_long.h +53 -0
- data/ext/pack/ruby/internal/arithmetic/mode_t.h +34 -0
- data/ext/pack/ruby/internal/arithmetic/off_t.h +49 -0
- data/ext/pack/ruby/internal/arithmetic/pid_t.h +34 -0
- data/ext/pack/ruby/internal/arithmetic/short.h +54 -0
- data/ext/pack/ruby/internal/arithmetic/size_t.h +51 -0
- data/ext/pack/ruby/internal/arithmetic/st_data_t.h +59 -0
- data/ext/pack/ruby/internal/arithmetic/uid_t.h +34 -0
- data/ext/pack/ruby/internal/assume.h +90 -0
- data/ext/pack/ruby/internal/attr/alloc_size.h +32 -0
- data/ext/pack/ruby/internal/attr/artificial.h +46 -0
- data/ext/pack/ruby/internal/attr/cold.h +37 -0
- data/ext/pack/ruby/internal/attr/const.h +46 -0
- data/ext/pack/ruby/internal/attr/constexpr.h +85 -0
- data/ext/pack/ruby/internal/attr/deprecated.h +59 -0
- data/ext/pack/ruby/internal/attr/diagnose_if.h +42 -0
- data/ext/pack/ruby/internal/attr/enum_extensibility.h +32 -0
- data/ext/pack/ruby/internal/attr/error.h +32 -0
- data/ext/pack/ruby/internal/attr/flag_enum.h +33 -0
- data/ext/pack/ruby/internal/attr/forceinline.h +40 -0
- data/ext/pack/ruby/internal/attr/format.h +38 -0
- data/ext/pack/ruby/internal/attr/maybe_unused.h +38 -0
- data/ext/pack/ruby/internal/attr/noalias.h +58 -0
- data/ext/pack/ruby/internal/attr/nodiscard.h +45 -0
- data/ext/pack/ruby/internal/attr/noexcept.h +91 -0
- data/ext/pack/ruby/internal/attr/noinline.h +35 -0
- data/ext/pack/ruby/internal/attr/nonnull.h +32 -0
- data/ext/pack/ruby/internal/attr/noreturn.h +48 -0
- data/ext/pack/ruby/internal/attr/pure.h +43 -0
- data/ext/pack/ruby/internal/attr/restrict.h +45 -0
- data/ext/pack/ruby/internal/attr/returns_nonnull.h +37 -0
- data/ext/pack/ruby/internal/attr/warning.h +32 -0
- data/ext/pack/ruby/internal/attr/weakref.h +32 -0
- data/ext/pack/ruby/internal/cast.h +53 -0
- data/ext/pack/ruby/internal/compiler_is.h +45 -0
- data/ext/pack/ruby/internal/compiler_is/apple.h +41 -0
- data/ext/pack/ruby/internal/compiler_is/clang.h +38 -0
- data/ext/pack/ruby/internal/compiler_is/gcc.h +46 -0
- data/ext/pack/ruby/internal/compiler_is/intel.h +41 -0
- data/ext/pack/ruby/internal/compiler_is/msvc.h +57 -0
- data/ext/pack/ruby/internal/compiler_is/sunpro.h +55 -0
- data/ext/pack/ruby/internal/compiler_since.h +61 -0
- data/ext/pack/ruby/internal/config.h +131 -0
- data/ext/pack/ruby/internal/constant_p.h +37 -0
- data/ext/pack/ruby/internal/core.h +35 -0
- data/ext/pack/ruby/internal/core/rarray.h +275 -0
- data/ext/pack/ruby/internal/core/rbasic.h +85 -0
- data/ext/pack/ruby/internal/core/rbignum.h +51 -0
- data/ext/pack/ruby/internal/core/rclass.h +47 -0
- data/ext/pack/ruby/internal/core/rdata.h +174 -0
- data/ext/pack/ruby/internal/core/rfile.h +36 -0
- data/ext/pack/ruby/internal/core/rhash.h +62 -0
- data/ext/pack/ruby/internal/core/rmatch.h +73 -0
- data/ext/pack/ruby/internal/core/robject.h +97 -0
- data/ext/pack/ruby/internal/core/rregexp.h +84 -0
- data/ext/pack/ruby/internal/core/rstring.h +215 -0
- data/ext/pack/ruby/internal/core/rstruct.h +73 -0
- data/ext/pack/ruby/internal/core/rtypeddata.h +184 -0
- data/ext/pack/ruby/internal/ctype.h +203 -0
- data/ext/pack/ruby/internal/dllexport.h +92 -0
- data/ext/pack/ruby/internal/dosish.h +63 -0
- data/ext/pack/ruby/internal/error.h +74 -0
- data/ext/pack/ruby/internal/eval.h +50 -0
- data/ext/pack/ruby/internal/event.h +75 -0
- data/ext/pack/ruby/internal/fl_type.h +469 -0
- data/ext/pack/ruby/internal/gc.h +35 -0
- data/ext/pack/ruby/internal/glob.h +35 -0
- data/ext/pack/ruby/internal/globals.h +159 -0
- data/ext/pack/ruby/internal/has/attribute.h +164 -0
- data/ext/pack/ruby/internal/has/builtin.h +105 -0
- data/ext/pack/ruby/internal/has/c_attribute.h +38 -0
- data/ext/pack/ruby/internal/has/cpp_attribute.h +79 -0
- data/ext/pack/ruby/internal/has/declspec_attribute.h +48 -0
- data/ext/pack/ruby/internal/has/extension.h +33 -0
- data/ext/pack/ruby/internal/has/feature.h +31 -0
- data/ext/pack/ruby/internal/has/warning.h +31 -0
- data/ext/pack/ruby/internal/intern/array.h +78 -0
- data/ext/pack/ruby/internal/intern/bignum.h +105 -0
- data/ext/pack/ruby/internal/intern/class.h +57 -0
- data/ext/pack/ruby/internal/intern/compar.h +34 -0
- data/ext/pack/ruby/internal/intern/complex.h +60 -0
- data/ext/pack/ruby/internal/intern/cont.h +40 -0
- data/ext/pack/ruby/internal/intern/dir.h +33 -0
- data/ext/pack/ruby/internal/intern/enum.h +33 -0
- data/ext/pack/ruby/internal/intern/enumerator.h +79 -0
- data/ext/pack/ruby/internal/intern/error.h +82 -0
- data/ext/pack/ruby/internal/intern/eval.h +59 -0
- data/ext/pack/ruby/internal/intern/file.h +44 -0
- data/ext/pack/ruby/internal/intern/gc.h +57 -0
- data/ext/pack/ruby/internal/intern/hash.h +59 -0
- data/ext/pack/ruby/internal/intern/io.h +70 -0
- data/ext/pack/ruby/internal/intern/load.h +39 -0
- data/ext/pack/ruby/internal/intern/marshal.h +35 -0
- data/ext/pack/ruby/internal/intern/numeric.h +42 -0
- data/ext/pack/ruby/internal/intern/object.h +90 -0
- data/ext/pack/ruby/internal/intern/parse.h +64 -0
- data/ext/pack/ruby/internal/intern/proc.h +53 -0
- data/ext/pack/ruby/internal/intern/process.h +46 -0
- data/ext/pack/ruby/internal/intern/random.h +45 -0
- data/ext/pack/ruby/internal/intern/range.h +35 -0
- data/ext/pack/ruby/internal/intern/rational.h +46 -0
- data/ext/pack/ruby/internal/intern/re.h +50 -0
- data/ext/pack/ruby/internal/intern/ruby.h +37 -0
- data/ext/pack/ruby/internal/intern/select.h +52 -0
- data/ext/pack/ruby/internal/intern/select/largesize.h +103 -0
- data/ext/pack/ruby/internal/intern/select/posix.h +82 -0
- data/ext/pack/ruby/internal/intern/select/win32.h +124 -0
- data/ext/pack/ruby/internal/intern/signal.h +40 -0
- data/ext/pack/ruby/internal/intern/sprintf.h +43 -0
- data/ext/pack/ruby/internal/intern/string.h +290 -0
- data/ext/pack/ruby/internal/intern/struct.h +47 -0
- data/ext/pack/ruby/internal/intern/thread.h +76 -0
- data/ext/pack/ruby/internal/intern/time.h +52 -0
- data/ext/pack/ruby/internal/intern/variable.h +83 -0
- data/ext/pack/ruby/internal/intern/vm.h +77 -0
- data/ext/pack/ruby/internal/interpreter.h +94 -0
- data/ext/pack/ruby/internal/iterator.h +65 -0
- data/ext/pack/ruby/internal/memory.h +286 -0
- data/ext/pack/ruby/internal/method.h +39 -0
- data/ext/pack/ruby/internal/module.h +39 -0
- data/ext/pack/ruby/internal/newobj.h +73 -0
- data/ext/pack/ruby/internal/rgengc.h +199 -0
- data/ext/pack/ruby/internal/scan_args.h +394 -0
- data/ext/pack/ruby/internal/special_consts.h +204 -0
- data/ext/pack/ruby/internal/static_assert.h +77 -0
- data/ext/pack/ruby/internal/stdalign.h +124 -0
- data/ext/pack/ruby/internal/stdbool.h +51 -0
- data/ext/pack/ruby/internal/symbol.h +114 -0
- data/ext/pack/ruby/internal/token_paste.h +75 -0
- data/ext/pack/ruby/internal/value.h +66 -0
- data/ext/pack/ruby/internal/value_type.h +354 -0
- data/ext/pack/ruby/internal/variable.h +62 -0
- data/ext/pack/ruby/internal/warning_push.h +91 -0
- data/ext/pack/ruby/internal/xmalloc.h +201 -0
- data/lib/zscan.rb +1 -1
- data/readme.md +2 -0
- data/zscan.gemspec +1 -1
- metadata +162 -2
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#ifndef RBIMPL_GC_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RBIMPL_GC_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 Registering values to the GC.
|
|
22
|
+
*/
|
|
23
|
+
#include "ruby/internal/dllexport.h"
|
|
24
|
+
#include "ruby/internal/value.h"
|
|
25
|
+
|
|
26
|
+
RBIMPL_SYMBOL_EXPORT_BEGIN()
|
|
27
|
+
|
|
28
|
+
void rb_global_variable(VALUE*);
|
|
29
|
+
void rb_gc_register_mark_object(VALUE);
|
|
30
|
+
void rb_gc_register_address(VALUE*);
|
|
31
|
+
void rb_gc_unregister_address(VALUE*);
|
|
32
|
+
|
|
33
|
+
RBIMPL_SYMBOL_EXPORT_END()
|
|
34
|
+
|
|
35
|
+
#endif /* RBIMPL_GC_H */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#ifndef RBIMPL_GLOB_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RBIMPL_GLOB_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 Declares ::rb_glob().
|
|
22
|
+
*/
|
|
23
|
+
#include "ruby/internal/dllexport.h"
|
|
24
|
+
#include "ruby/internal/value.h"
|
|
25
|
+
|
|
26
|
+
RBIMPL_SYMBOL_EXPORT_BEGIN()
|
|
27
|
+
|
|
28
|
+
typedef int ruby_glob_func(const char*,VALUE, void*);
|
|
29
|
+
void rb_glob(const char*,void(*)(const char*,VALUE,void*),VALUE);
|
|
30
|
+
int ruby_glob(const char*,int,ruby_glob_func*,VALUE);
|
|
31
|
+
int ruby_brace_glob(const char*,int,ruby_glob_func*,VALUE);
|
|
32
|
+
|
|
33
|
+
RBIMPL_SYMBOL_EXPORT_END()
|
|
34
|
+
|
|
35
|
+
#endif /* RBIMPL_GLOB_H */
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
#ifndef RBIMPL_GLOBALS_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RBIMPL_GLOBALS_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 Ruby-level global variables / constants, visible from C.
|
|
22
|
+
*/
|
|
23
|
+
#include "ruby/internal/attr/pure.h"
|
|
24
|
+
#include "ruby/internal/dllexport.h"
|
|
25
|
+
#include "ruby/internal/fl_type.h"
|
|
26
|
+
#include "ruby/internal/special_consts.h"
|
|
27
|
+
#include "ruby/internal/value.h"
|
|
28
|
+
#include "ruby/internal/value_type.h"
|
|
29
|
+
|
|
30
|
+
RBIMPL_SYMBOL_EXPORT_BEGIN()
|
|
31
|
+
|
|
32
|
+
#define RUBY_INTEGER_UNIFICATION 1
|
|
33
|
+
|
|
34
|
+
RUBY_EXTERN VALUE rb_mKernel;
|
|
35
|
+
RUBY_EXTERN VALUE rb_mComparable;
|
|
36
|
+
RUBY_EXTERN VALUE rb_mEnumerable;
|
|
37
|
+
RUBY_EXTERN VALUE rb_mErrno;
|
|
38
|
+
RUBY_EXTERN VALUE rb_mFileTest;
|
|
39
|
+
RUBY_EXTERN VALUE rb_mGC;
|
|
40
|
+
RUBY_EXTERN VALUE rb_mMath;
|
|
41
|
+
RUBY_EXTERN VALUE rb_mProcess;
|
|
42
|
+
RUBY_EXTERN VALUE rb_mWaitReadable;
|
|
43
|
+
RUBY_EXTERN VALUE rb_mWaitWritable;
|
|
44
|
+
|
|
45
|
+
RUBY_EXTERN VALUE rb_cBasicObject;
|
|
46
|
+
RUBY_EXTERN VALUE rb_cObject;
|
|
47
|
+
RUBY_EXTERN VALUE rb_cArray;
|
|
48
|
+
RUBY_EXTERN VALUE rb_cBinding;
|
|
49
|
+
RUBY_EXTERN VALUE rb_cClass;
|
|
50
|
+
RUBY_EXTERN VALUE rb_cCont;
|
|
51
|
+
RUBY_EXTERN VALUE rb_cData;
|
|
52
|
+
RUBY_EXTERN VALUE rb_cDir;
|
|
53
|
+
RUBY_EXTERN VALUE rb_cEncoding;
|
|
54
|
+
RUBY_EXTERN VALUE rb_cEnumerator;
|
|
55
|
+
RUBY_EXTERN VALUE rb_cFalseClass;
|
|
56
|
+
RUBY_EXTERN VALUE rb_cFile;
|
|
57
|
+
RUBY_EXTERN VALUE rb_cComplex;
|
|
58
|
+
RUBY_EXTERN VALUE rb_cFloat;
|
|
59
|
+
RUBY_EXTERN VALUE rb_cHash;
|
|
60
|
+
RUBY_EXTERN VALUE rb_cIO;
|
|
61
|
+
RUBY_EXTERN VALUE rb_cInteger;
|
|
62
|
+
RUBY_EXTERN VALUE rb_cMatch;
|
|
63
|
+
RUBY_EXTERN VALUE rb_cMethod;
|
|
64
|
+
RUBY_EXTERN VALUE rb_cModule;
|
|
65
|
+
RUBY_EXTERN VALUE rb_cNameErrorMesg;
|
|
66
|
+
RUBY_EXTERN VALUE rb_cNilClass;
|
|
67
|
+
RUBY_EXTERN VALUE rb_cNumeric;
|
|
68
|
+
RUBY_EXTERN VALUE rb_cProc;
|
|
69
|
+
RUBY_EXTERN VALUE rb_cRandom;
|
|
70
|
+
RUBY_EXTERN VALUE rb_cRange;
|
|
71
|
+
RUBY_EXTERN VALUE rb_cRational;
|
|
72
|
+
RUBY_EXTERN VALUE rb_cRegexp;
|
|
73
|
+
RUBY_EXTERN VALUE rb_cStat;
|
|
74
|
+
RUBY_EXTERN VALUE rb_cString;
|
|
75
|
+
RUBY_EXTERN VALUE rb_cStruct;
|
|
76
|
+
RUBY_EXTERN VALUE rb_cSymbol;
|
|
77
|
+
RUBY_EXTERN VALUE rb_cThread;
|
|
78
|
+
RUBY_EXTERN VALUE rb_cTime;
|
|
79
|
+
RUBY_EXTERN VALUE rb_cTrueClass;
|
|
80
|
+
RUBY_EXTERN VALUE rb_cUnboundMethod;
|
|
81
|
+
|
|
82
|
+
RUBY_EXTERN VALUE rb_eException;
|
|
83
|
+
RUBY_EXTERN VALUE rb_eStandardError;
|
|
84
|
+
RUBY_EXTERN VALUE rb_eSystemExit;
|
|
85
|
+
RUBY_EXTERN VALUE rb_eInterrupt;
|
|
86
|
+
RUBY_EXTERN VALUE rb_eSignal;
|
|
87
|
+
RUBY_EXTERN VALUE rb_eFatal;
|
|
88
|
+
RUBY_EXTERN VALUE rb_eArgError;
|
|
89
|
+
RUBY_EXTERN VALUE rb_eEOFError;
|
|
90
|
+
RUBY_EXTERN VALUE rb_eIndexError;
|
|
91
|
+
RUBY_EXTERN VALUE rb_eStopIteration;
|
|
92
|
+
RUBY_EXTERN VALUE rb_eKeyError;
|
|
93
|
+
RUBY_EXTERN VALUE rb_eRangeError;
|
|
94
|
+
RUBY_EXTERN VALUE rb_eIOError;
|
|
95
|
+
RUBY_EXTERN VALUE rb_eRuntimeError;
|
|
96
|
+
RUBY_EXTERN VALUE rb_eFrozenError;
|
|
97
|
+
RUBY_EXTERN VALUE rb_eSecurityError;
|
|
98
|
+
RUBY_EXTERN VALUE rb_eSystemCallError;
|
|
99
|
+
RUBY_EXTERN VALUE rb_eThreadError;
|
|
100
|
+
RUBY_EXTERN VALUE rb_eTypeError;
|
|
101
|
+
RUBY_EXTERN VALUE rb_eZeroDivError;
|
|
102
|
+
RUBY_EXTERN VALUE rb_eNotImpError;
|
|
103
|
+
RUBY_EXTERN VALUE rb_eNoMemError;
|
|
104
|
+
RUBY_EXTERN VALUE rb_eNoMethodError;
|
|
105
|
+
RUBY_EXTERN VALUE rb_eFloatDomainError;
|
|
106
|
+
RUBY_EXTERN VALUE rb_eLocalJumpError;
|
|
107
|
+
RUBY_EXTERN VALUE rb_eSysStackError;
|
|
108
|
+
RUBY_EXTERN VALUE rb_eRegexpError;
|
|
109
|
+
RUBY_EXTERN VALUE rb_eEncodingError;
|
|
110
|
+
RUBY_EXTERN VALUE rb_eEncCompatError;
|
|
111
|
+
RUBY_EXTERN VALUE rb_eNoMatchingPatternError;
|
|
112
|
+
|
|
113
|
+
RUBY_EXTERN VALUE rb_eScriptError;
|
|
114
|
+
RUBY_EXTERN VALUE rb_eNameError;
|
|
115
|
+
RUBY_EXTERN VALUE rb_eSyntaxError;
|
|
116
|
+
RUBY_EXTERN VALUE rb_eLoadError;
|
|
117
|
+
|
|
118
|
+
RUBY_EXTERN VALUE rb_eMathDomainError;
|
|
119
|
+
|
|
120
|
+
RUBY_EXTERN VALUE rb_stdin, rb_stdout, rb_stderr;
|
|
121
|
+
|
|
122
|
+
RBIMPL_ATTR_PURE()
|
|
123
|
+
static inline VALUE
|
|
124
|
+
rb_class_of(VALUE obj)
|
|
125
|
+
{
|
|
126
|
+
if (! RB_SPECIAL_CONST_P(obj)) {
|
|
127
|
+
return RBASIC_CLASS(obj);
|
|
128
|
+
}
|
|
129
|
+
else if (obj == RUBY_Qfalse) {
|
|
130
|
+
return rb_cFalseClass;
|
|
131
|
+
}
|
|
132
|
+
else if (obj == RUBY_Qnil) {
|
|
133
|
+
return rb_cNilClass;
|
|
134
|
+
}
|
|
135
|
+
else if (obj == RUBY_Qtrue) {
|
|
136
|
+
return rb_cTrueClass;
|
|
137
|
+
}
|
|
138
|
+
else if (RB_FIXNUM_P(obj)) {
|
|
139
|
+
return rb_cInteger;
|
|
140
|
+
}
|
|
141
|
+
else if (RB_STATIC_SYM_P(obj)) {
|
|
142
|
+
return rb_cSymbol;
|
|
143
|
+
}
|
|
144
|
+
else if (RB_FLONUM_P(obj)) {
|
|
145
|
+
return rb_cFloat;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
#if RUBY_NDEBUG
|
|
149
|
+
RBIMPL_UNREACHABLE_RETURN(Qfalse);
|
|
150
|
+
#else
|
|
151
|
+
RUBY_ASSERT_FAIL("unexpected type");
|
|
152
|
+
#endif
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
#define CLASS_OF rb_class_of
|
|
156
|
+
|
|
157
|
+
RBIMPL_SYMBOL_EXPORT_END()
|
|
158
|
+
|
|
159
|
+
#endif /* RBIMPL_GLOBALS_H */
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
#ifndef RBIMPL_HAS_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RBIMPL_HAS_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_ATTRIBUTE.
|
|
22
|
+
*/
|
|
23
|
+
#include "ruby/internal/config.h"
|
|
24
|
+
#include "ruby/internal/compiler_since.h"
|
|
25
|
+
#include "ruby/internal/token_paste.h"
|
|
26
|
+
|
|
27
|
+
#if defined(__has_attribute)
|
|
28
|
+
# if __has_attribute(pure) || RBIMPL_COMPILER_IS(GCC)
|
|
29
|
+
# /* FreeBSD's <sys/cdefs.h> defines its own *broken* version of
|
|
30
|
+
# * __has_attribute. Cygwin copied that content to be a victim of the
|
|
31
|
+
# * broken-ness. We don't take them into account. */
|
|
32
|
+
# define RBIMPL_HAVE___HAS_ATTRIBUTE 1
|
|
33
|
+
# endif
|
|
34
|
+
#endif
|
|
35
|
+
|
|
36
|
+
/** Wraps (or simulates) `__has_attribute`. */
|
|
37
|
+
#if defined(RBIMPL_HAVE___HAS_ATTRIBUTE)
|
|
38
|
+
# define RBIMPL_HAS_ATTRIBUTE(_) __has_attribute(_)
|
|
39
|
+
|
|
40
|
+
#elif RBIMPL_COMPILER_IS(GCC)
|
|
41
|
+
# /* GCC <= 4 lack __has_attribute predefined macro, while have attributes
|
|
42
|
+
# * themselves. We can simulate the macro like the following: */
|
|
43
|
+
# define RBIMPL_HAS_ATTRIBUTE(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_ATTRIBUTE_, _)
|
|
44
|
+
# define RBIMPL_HAS_ATTRIBUTE_aligned RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
|
|
45
|
+
# define RBIMPL_HAS_ATTRIBUTE_alloc_size RBIMPL_COMPILER_SINCE(GCC, 4, 3, 0)
|
|
46
|
+
# define RBIMPL_HAS_ATTRIBUTE_artificial RBIMPL_COMPILER_SINCE(GCC, 4, 3, 0)
|
|
47
|
+
# define RBIMPL_HAS_ATTRIBUTE_always_inline RBIMPL_COMPILER_SINCE(GCC, 3, 1, 0)
|
|
48
|
+
# define RBIMPL_HAS_ATTRIBUTE_cdecl RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
|
|
49
|
+
# define RBIMPL_HAS_ATTRIBUTE_cold RBIMPL_COMPILER_SINCE(GCC, 4, 3, 0)
|
|
50
|
+
# define RBIMPL_HAS_ATTRIBUTE_const RBIMPL_COMPILER_SINCE(GCC, 2, 6, 0)
|
|
51
|
+
# define RBIMPL_HAS_ATTRIBUTE_deprecated RBIMPL_COMPILER_SINCE(GCC, 3, 1, 0)
|
|
52
|
+
# define RBIMPL_HAS_ATTRIBUTE_dllexport RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
|
|
53
|
+
# define RBIMPL_HAS_ATTRIBUTE_dllimport RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
|
|
54
|
+
# define RBIMPL_HAS_ATTRIBUTE_error RBIMPL_COMPILER_SINCE(GCC, 4, 3, 0)
|
|
55
|
+
# define RBIMPL_HAS_ATTRIBUTE_format RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
|
|
56
|
+
# define RBIMPL_HAS_ATTRIBUTE_hot RBIMPL_COMPILER_SINCE(GCC, 4, 3, 0)
|
|
57
|
+
# define RBIMPL_HAS_ATTRIBUTE_leaf RBIMPL_COMPILER_SINCE(GCC, 4, 6, 0)
|
|
58
|
+
# define RBIMPL_HAS_ATTRIBUTE_malloc RBIMPL_COMPILER_SINCE(GCC, 3, 0, 0)
|
|
59
|
+
# define RBIMPL_HAS_ATTRIBUTE_no_address_safety_analysis RBIMPL_COMPILER_SINCE(GCC, 4, 8, 0)
|
|
60
|
+
# define RBIMPL_HAS_ATTRIBUTE_no_sanitize_address RBIMPL_COMPILER_SINCE(GCC, 4, 8, 0)
|
|
61
|
+
# define RBIMPL_HAS_ATTRIBUTE_no_sanitize_undefined RBIMPL_COMPILER_SINCE(GCC, 4, 9, 0)
|
|
62
|
+
# define RBIMPL_HAS_ATTRIBUTE_noinline RBIMPL_COMPILER_SINCE(GCC, 3, 1, 0)
|
|
63
|
+
# define RBIMPL_HAS_ATTRIBUTE_nonnull RBIMPL_COMPILER_SINCE(GCC, 3, 3, 0)
|
|
64
|
+
# define RBIMPL_HAS_ATTRIBUTE_noreturn RBIMPL_COMPILER_SINCE(GCC, 2, 5, 0)
|
|
65
|
+
# define RBIMPL_HAS_ATTRIBUTE_nothrow RBIMPL_COMPILER_SINCE(GCC, 3, 3, 0)
|
|
66
|
+
# define RBIMPL_HAS_ATTRIBUTE_pure RBIMPL_COMPILER_SINCE(GCC, 2,96, 0)
|
|
67
|
+
# define RBIMPL_HAS_ATTRIBUTE_returns_nonnull RBIMPL_COMPILER_SINCE(GCC, 4, 9, 0)
|
|
68
|
+
# define RBIMPL_HAS_ATTRIBUTE_returns_twice RBIMPL_COMPILER_SINCE(GCC, 4, 1, 0)
|
|
69
|
+
# define RBIMPL_HAS_ATTRIBUTE_stdcall RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
|
|
70
|
+
# define RBIMPL_HAS_ATTRIBUTE_unused RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
|
|
71
|
+
# define RBIMPL_HAS_ATTRIBUTE_visibility RBIMPL_COMPILER_SINCE(GCC, 3, 3, 0)
|
|
72
|
+
# define RBIMPL_HAS_ATTRIBUTE_warn_unused_result RBIMPL_COMPILER_SINCE(GCC, 3, 4, 0)
|
|
73
|
+
# define RBIMPL_HAS_ATTRIBUTE_warning RBIMPL_COMPILER_SINCE(GCC, 4, 3, 0)
|
|
74
|
+
# define RBIMPL_HAS_ATTRIBUTE_weak RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
|
|
75
|
+
# /* Note that "0, 0, 0" might be inaccurate. */
|
|
76
|
+
|
|
77
|
+
#elif RBIMPL_COMPILER_IS(SunPro)
|
|
78
|
+
# /* Oracle Solaris Studio 12.4 (cc version 5.11) introduced __has_attribute.
|
|
79
|
+
# * Before that, following attributes were available. */
|
|
80
|
+
# /* See https://docs.oracle.com/cd/F24633_01/index.html */
|
|
81
|
+
# define RBIMPL_HAS_ATTRIBUTE(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_ATTRIBUTE_, _)
|
|
82
|
+
# define RBIMPL_HAS_ATTRIBUTE_alias RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
|
|
83
|
+
# define RBIMPL_HAS_ATTRIBUTE_aligned RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
|
|
84
|
+
# define RBIMPL_HAS_ATTRIBUTE_always_inline RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0)
|
|
85
|
+
# define RBIMPL_HAS_ATTRIBUTE_const RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
|
|
86
|
+
# define RBIMPL_HAS_ATTRIBUTE_constructor RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
|
|
87
|
+
# define RBIMPL_HAS_ATTRIBUTE_destructor RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
|
|
88
|
+
# define RBIMPL_HAS_ATTRIBUTE_malloc RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
|
|
89
|
+
# define RBIMPL_HAS_ATTRIBUTE_noinline RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
|
|
90
|
+
# define RBIMPL_HAS_ATTRIBUTE_noreturn RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
|
|
91
|
+
# define RBIMPL_HAS_ATTRIBUTE_packed RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
|
|
92
|
+
# define RBIMPL_HAS_ATTRIBUTE_pure RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
|
|
93
|
+
# define RBIMPL_HAS_ATTRIBUTE_returns_twice RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0)
|
|
94
|
+
# define RBIMPL_HAS_ATTRIBUTE_vector_size RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0)
|
|
95
|
+
# define RBIMPL_HAS_ATTRIBUTE_visibility RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
|
|
96
|
+
# define RBIMPL_HAS_ATTRIBUTE_weak RBIMPL_COMPILER_SINCE(SunPro, 5, 9, 0)
|
|
97
|
+
|
|
98
|
+
#elif defined (_MSC_VER)
|
|
99
|
+
# define RBIMPL_HAS_ATTRIBUTE(_) 0
|
|
100
|
+
# /* Fallback below doesn't work: see win32/Makefile.sub */
|
|
101
|
+
|
|
102
|
+
#else
|
|
103
|
+
# /* Take config.h definition when available. */
|
|
104
|
+
# define RBIMPL_HAS_ATTRIBUTE(_) (RBIMPL_TOKEN_PASTE(RBIMPL_HAS_ATTRIBUTE_, _)+0)
|
|
105
|
+
# ifdef ALWAYS_INLINE
|
|
106
|
+
# define RBIMPL_HAS_ATTRIBUTE_always_inline 1
|
|
107
|
+
# endif
|
|
108
|
+
# ifdef FUNC_CDECL
|
|
109
|
+
# define RBIMPL_HAS_ATTRIBUTE_cdecl 1
|
|
110
|
+
# endif
|
|
111
|
+
# ifdef CONSTFUNC
|
|
112
|
+
# define RBIMPL_HAS_ATTRIBUTE_const 1
|
|
113
|
+
# endif
|
|
114
|
+
# ifdef DEPRECATED
|
|
115
|
+
# define RBIMPL_HAS_ATTRIBUTE_deprecated 1
|
|
116
|
+
# endif
|
|
117
|
+
# ifdef ERRORFUNC
|
|
118
|
+
# define RBIMPL_HAS_ATTRIBUTE_error 1
|
|
119
|
+
# endif
|
|
120
|
+
# ifdef FUNC_FASTCALL
|
|
121
|
+
# define RBIMPL_HAS_ATTRIBUTE_fastcall 1
|
|
122
|
+
# endif
|
|
123
|
+
# ifdef PUREFUNC
|
|
124
|
+
# define RBIMPL_HAS_ATTRIBUTE_pure 1
|
|
125
|
+
# endif
|
|
126
|
+
# ifdef NO_ADDRESS_SAFETY_ANALYSIS
|
|
127
|
+
# define RBIMPL_HAS_ATTRIBUTE_no_address_safety_analysis 1
|
|
128
|
+
# endif
|
|
129
|
+
# ifdef NO_SANITIZE
|
|
130
|
+
# define RBIMPL_HAS_ATTRIBUTE_no_sanitize 1
|
|
131
|
+
# endif
|
|
132
|
+
# ifdef NO_SANITIZE_ADDRESS
|
|
133
|
+
# define RBIMPL_HAS_ATTRIBUTE_no_sanitize_address 1
|
|
134
|
+
# endif
|
|
135
|
+
# ifdef NOINLINE
|
|
136
|
+
# define RBIMPL_HAS_ATTRIBUTE_noinline 1
|
|
137
|
+
# endif
|
|
138
|
+
# ifdef RBIMPL_FUNC_NONNULL
|
|
139
|
+
# define RBIMPL_HAS_ATTRIBUTE_nonnull 1
|
|
140
|
+
# endif
|
|
141
|
+
# ifdef NORETURN
|
|
142
|
+
# define RBIMPL_HAS_ATTRIBUTE_noreturn 1
|
|
143
|
+
# endif
|
|
144
|
+
# ifdef FUNC_OPTIMIZED
|
|
145
|
+
# define RBIMPL_HAS_ATTRIBUTE_optimize 1
|
|
146
|
+
# endif
|
|
147
|
+
# ifdef FUNC_STDCALL
|
|
148
|
+
# define RBIMPL_HAS_ATTRIBUTE_stdcall 1
|
|
149
|
+
# endif
|
|
150
|
+
# ifdef MAYBE_UNUSED
|
|
151
|
+
# define RBIMPL_HAS_ATTRIBUTE_unused 1
|
|
152
|
+
# endif
|
|
153
|
+
# ifdef WARN_UNUSED_RESULT
|
|
154
|
+
# define RBIMPL_HAS_ATTRIBUTE_warn_unused_result 1
|
|
155
|
+
# endif
|
|
156
|
+
# ifdef WARNINGFUNC
|
|
157
|
+
# define RBIMPL_HAS_ATTRIBUTE_warning 1
|
|
158
|
+
# endif
|
|
159
|
+
# ifdef WEAK
|
|
160
|
+
# define RBIMPL_HAS_ATTRIBUTE_weak 1
|
|
161
|
+
# endif
|
|
162
|
+
#endif
|
|
163
|
+
|
|
164
|
+
#endif /* RBIMPL_HAS_ATTRIBUTE_H */
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#ifndef RBIMPL_HAS_BUILTIN_H /*-*-C++-*-vi:se ft=cpp:*/
|
|
2
|
+
#define RBIMPL_HAS_BUILTIN_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_BUILTIN.
|
|
22
|
+
*/
|
|
23
|
+
#include "ruby/internal/config.h"
|
|
24
|
+
#include "ruby/internal/compiler_since.h"
|
|
25
|
+
#include "ruby/internal/token_paste.h"
|
|
26
|
+
|
|
27
|
+
#if defined(__has_builtin)
|
|
28
|
+
# if RBIMPL_COMPILER_IS(Intel)
|
|
29
|
+
# /* :TODO: Intel C Compiler has __has_builtin (since 19.1 maybe?), and is
|
|
30
|
+
# * reportedly broken. We have to skip them. However the situation can
|
|
31
|
+
# * change. They might improve someday. We need to revisit here later. */
|
|
32
|
+
# elif RBIMPL_COMPILER_IS(GCC) && ! __has_builtin(__builtin_alloca)
|
|
33
|
+
# /* FreeBSD's <sys/cdefs.h> defines its own *broken* version of
|
|
34
|
+
# * __has_builtin. Cygwin copied that content to be a victim of the
|
|
35
|
+
# * broken-ness. We don't take them into account. */
|
|
36
|
+
# else
|
|
37
|
+
# define RBIMPL_HAVE___HAS_BUILTIN 1
|
|
38
|
+
# endif
|
|
39
|
+
#endif
|
|
40
|
+
|
|
41
|
+
/** Wraps (or simulates) `__has_builtin`. */
|
|
42
|
+
#if defined(RBIMPL_HAVE___HAS_BUILTIN)
|
|
43
|
+
# define RBIMPL_HAS_BUILTIN(_) __has_builtin(_)
|
|
44
|
+
|
|
45
|
+
#elif RBIMPL_COMPILER_IS(GCC)
|
|
46
|
+
# /* :FIXME: Historically GCC has had tons of builtins, but it implemented
|
|
47
|
+
# * __has_builtin only since GCC 10. This section can be made more
|
|
48
|
+
# * granular. */
|
|
49
|
+
# /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66970 */
|
|
50
|
+
# define RBIMPL_HAS_BUILTIN(_) RBIMPL_TOKEN_PASTE(RBIMPL_HAS_BUILTIN_, _)
|
|
51
|
+
# define RBIMPL_HAS_BUILTIN___builtin_add_overflow RBIMPL_COMPILER_SINCE(GCC, 5, 1, 0)
|
|
52
|
+
# define RBIMPL_HAS_BUILTIN___builtin_alloca RBIMPL_COMPILER_SINCE(GCC, 0, 0, 0)
|
|
53
|
+
# define RBIMPL_HAS_BUILTIN___builtin_alloca_with_align RBIMPL_COMPILER_SINCE(GCC, 6, 1, 0)
|
|
54
|
+
# /* See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624 for bswap16. */
|
|
55
|
+
# define RBIMPL_HAS_BUILTIN___builtin_bswap16 RBIMPL_COMPILER_SINCE(GCC, 4, 8, 0)
|
|
56
|
+
# define RBIMPL_HAS_BUILTIN___builtin_bswap32 RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
|
|
57
|
+
# define RBIMPL_HAS_BUILTIN___builtin_bswap64 RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
|
|
58
|
+
# define RBIMPL_HAS_BUILTIN___builtin_clz RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
|
|
59
|
+
# define RBIMPL_HAS_BUILTIN___builtin_clzl RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
|
|
60
|
+
# define RBIMPL_HAS_BUILTIN___builtin_clzll RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
|
|
61
|
+
# define RBIMPL_HAS_BUILTIN___builtin_constant_p RBIMPL_COMPILER_SINCE(GCC, 2,95, 3)
|
|
62
|
+
# define RBIMPL_HAS_BUILTIN___builtin_ctz RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
|
|
63
|
+
# define RBIMPL_HAS_BUILTIN___builtin_ctzl RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
|
|
64
|
+
# define RBIMPL_HAS_BUILTIN___builtin_ctzll RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
|
|
65
|
+
# define RBIMPL_HAS_BUILTIN___builtin_expect RBIMPL_COMPILER_SINCE(GCC, 3, 0, 0)
|
|
66
|
+
# define RBIMPL_HAS_BUILTIN___builtin_mul_overflow RBIMPL_COMPILER_SINCE(GCC, 5, 1, 0)
|
|
67
|
+
# define RBIMPL_HAS_BUILTIN___builtin_mul_overflow_p RBIMPL_COMPILER_SINCE(GCC, 7, 0, 0)
|
|
68
|
+
# define RBIMPL_HAS_BUILTIN___builtin_popcount RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
|
|
69
|
+
# define RBIMPL_HAS_BUILTIN___builtin_popcountl RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
|
|
70
|
+
# define RBIMPL_HAS_BUILTIN___builtin_popcountll RBIMPL_COMPILER_SINCE(GCC, 3, 6, 0)
|
|
71
|
+
# define RBIMPL_HAS_BUILTIN___builtin_sub_overflow RBIMPL_COMPILER_SINCE(GCC, 5, 1, 0)
|
|
72
|
+
# define RBIMPL_HAS_BUILTIN___builtin_unreachable RBIMPL_COMPILER_SINCE(GCC, 4, 5, 0)
|
|
73
|
+
# /* Note that "0, 0, 0" might be inaccurate. */
|
|
74
|
+
|
|
75
|
+
#elif RBIMPL_COMPILER_IS(MSVC)
|
|
76
|
+
# /* MSVC has UNREACHABLE, but that is not __builtin_unreachable. */
|
|
77
|
+
# define RBIMPL_HAS_BUILTIN(_) 0
|
|
78
|
+
|
|
79
|
+
#else
|
|
80
|
+
# /* Take config.h definition when available */
|
|
81
|
+
# define RBIMPL_HAS_BUILTIN(_) (RBIMPL_TOKEN_PASTE(RBIMPL_HAS_BUILTIN_, _)+0)
|
|
82
|
+
# define RBIMPL_HAS_BUILTIN___builtin_add_overflow HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW
|
|
83
|
+
# define RBIMPL_HAS_BUILTIN___builtin_alloca_with_align HAVE_BUILTIN___BUILTIN_ALLOCA_WITH_ALIGN
|
|
84
|
+
# define RBIMPL_HAS_BUILTIN___builtin_assume_aligned HAVE_BUILTIN___BUILTIN_ASSUME_ALIGNED
|
|
85
|
+
# define RBIMPL_HAS_BUILTIN___builtin_bswap16 HAVE_BUILTIN___BUILTIN_BSWAP16
|
|
86
|
+
# define RBIMPL_HAS_BUILTIN___builtin_bswap32 HAVE_BUILTIN___BUILTIN_BSWAP32
|
|
87
|
+
# define RBIMPL_HAS_BUILTIN___builtin_bswap64 HAVE_BUILTIN___BUILTIN_BSWAP64
|
|
88
|
+
# define RBIMPL_HAS_BUILTIN___builtin_clz HAVE_BUILTIN___BUILTIN_CLZ
|
|
89
|
+
# define RBIMPL_HAS_BUILTIN___builtin_clzl HAVE_BUILTIN___BUILTIN_CLZL
|
|
90
|
+
# define RBIMPL_HAS_BUILTIN___builtin_clzll HAVE_BUILTIN___BUILTIN_CLZLL
|
|
91
|
+
# define RBIMPL_HAS_BUILTIN___builtin_constant_p HAVE_BUILTIN___BUILTIN_CONSTANT_P
|
|
92
|
+
# define RBIMPL_HAS_BUILTIN___builtin_ctz HAVE_BUILTIN___BUILTIN_CTZ
|
|
93
|
+
# define RBIMPL_HAS_BUILTIN___builtin_ctzll HAVE_BUILTIN___BUILTIN_CTZLL
|
|
94
|
+
# define RBIMPL_HAS_BUILTIN___builtin_expect HAVE_BUILTIN___BUILTIN_EXPECT
|
|
95
|
+
# define RBIMPL_HAS_BUILTIN___builtin_mul_overflow HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
|
|
96
|
+
# define RBIMPL_HAS_BUILTIN___builtin_mul_overflow_p HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P
|
|
97
|
+
# define RBIMPL_HAS_BUILTIN___builtin_popcount HAVE_BUILTIN___BUILTIN_POPCOUNT
|
|
98
|
+
# define RBIMPL_HAS_BUILTIN___builtin_popcountll HAVE_BUILTIN___BUILTIN_POPCOUNTLL
|
|
99
|
+
# define RBIMPL_HAS_BUILTIN___builtin_sub_overflow HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW
|
|
100
|
+
# if defined(UNREACHABLE)
|
|
101
|
+
# define RBIMPL_HAS_BUILTIN___builtin_unreachable 1
|
|
102
|
+
# endif
|
|
103
|
+
#endif
|
|
104
|
+
|
|
105
|
+
#endif /* RBIMPL_HAS_BUILTIN_H */
|