1#ifndef INTERNAL_COMPILERS_H
2#define INTERNAL_COMPILERS_H
19#include "ruby/backward/2/gcc_version_since.h"
21#ifndef __has_attribute
22# define __has_attribute(...) RBIMPL_HAS_ATTRIBUTE(__VA_ARGS__)
25#ifndef __has_c_attribute
28# define __has_c_attribute(...) 0
31#ifndef __has_declspec_attribute
32# define __has_declspec_attribute(...) RBIMPL_HAS_DECLSPEC_ATTRIBUTE(__VA_ARGS__)
36# define __has_builtin(...) RBIMPL_HAS_BUILTIN(__VA_ARGS__)
40# define __has_feature(...) RBIMPL_HAS_FEATURE(__VA_ARGS__)
43#ifndef __has_extension
44# define __has_extension(...) RBIMPL_HAS_EXTENSION(__VA_ARGS__)
48# define __has_warning(...) RBIMPL_HAS_WARNING(__VA_ARGS__)
56# define MAYBE_UNUSED(x) x
59#ifndef WARN_UNUSED_RESULT
60# define WARN_UNUSED_RESULT(x) x
63#define RB_OBJ_BUILTIN_TYPE(obj) rb_obj_builtin_type(obj)
64#define OBJ_BUILTIN_TYPE(obj) RB_OBJ_BUILTIN_TYPE(obj)
66#define rb_obj_builtin_type(obj) \
68 VALUE arg_obj = (obj); \
69 RB_SPECIAL_CONST_P(arg_obj) ? -1 : \
70 (int)RB_BUILTIN_TYPE(arg_obj); \
75rb_obj_builtin_type(
VALUE obj)
83#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || defined(_MSC_VER)
85#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
86# define FLEX_ARY_LEN 0
88# define FLEX_ARY_LEN 1
98#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(_MSC_VER)
99# define BITFIELD(type, name, size) type name : size
101# define BITFIELD(type, name, size) unsigned int name : size
Defines RBIMPL_HAS_ATTRIBUTE.
Defines RBIMPL_HAS_C_ATTRIBUTE.
Defines RBIMPL_COMPILER_SINCE.
Defines RBIMPL_HAS_DECLSPEC_ATTRIBUTE.
Defines RBIMPL_HAS_FEATURE.
Defines RBIMPL_HAS_WARNING.
Defines RBIMPL_HAS_BUILTIN.
Defines RBIMPL_HAS_EXTENSION.
static bool RB_SPECIAL_CONST_P(VALUE obj)
Checks if the given object is of enum ruby_special_consts.
uintptr_t VALUE
Type that represents a Ruby object.
static enum ruby_value_type RB_BUILTIN_TYPE(VALUE obj)
Queries the type of the object.