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,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 */
|