1#ifndef RBIMPL_ARITHMETIC_INT_H
2#define RBIMPL_ARITHMETIC_INT_H
37#define RB_INT2NUM rb_int2num_inline
38#define RB_NUM2INT rb_num2int_inline
39#define RB_UINT2NUM rb_uint2num_inline
41#define FIX2INT RB_FIX2INT
42#define FIX2UINT RB_FIX2UINT
43#define INT2NUM RB_INT2NUM
44#define NUM2INT RB_NUM2INT
45#define NUM2UINT RB_NUM2UINT
46#define UINT2NUM RB_UINT2NUM
49#define RB_FIX2INT RB_FIX2INT
50#define RB_NUM2UINT RB_NUM2UINT
51#define RB_FIX2UINT RB_FIX2UINT
73 if (
sizeof(
int) <
sizeof(
long)) {
80 return RBIMPL_CAST((
int)ret);
84rb_num2int_inline(
VALUE x)
88 if (
sizeof(
int) ==
sizeof(
long)) {
91 else if (RB_FIXNUM_P(x)) {
98 return RBIMPL_CAST((
int)ret);
102static inline
unsigned int
107 if (
sizeof(
int) <
sizeof(
long)) {
114 return RBIMPL_CAST((
unsigned int)ret);
118static inline
unsigned int
126 if (
sizeof(
int) <
sizeof(
long)) {
133 return RBIMPL_CAST((
unsigned int)ret);
137#if RBIMPL_COMPILER_IS(GCC)
138RBIMPL_WARNING_IGNORED(-Wtype-limits)
139#elif RBIMPL_HAS_WARNING("-Wtautological-constant-out-of-range-compare")
140RBIMPL_WARNING_IGNORED(-Wtautological-constant-
out-of-
range-compare)
144rb_int2num_inline(
int v)
147 return RB_INT2FIX(v);
153rb_uint2num_inline(
unsigned int v)
Defines RBIMPL_ATTR_ARTIFICIAL.
#define RBIMPL_ATTR_ARTIFICIAL()
Wraps (or simulates) __attribute__((artificial))
#define RBIMPL_ASSERT_OR_ASSUME(expr)
This is either RUBY_ASSERT or RBIMPL_ASSUME, depending on RUBY_DEBUG.
VALUE rb_int2big(intptr_t n)
VALUE rb_uint2big(uintptr_t n)
Defines RBIMPL_COMPILER_IS.
Defines RBIMPL_ATTR_CONST.
#define range(low, item, hi)
Tewaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Handling of integers formerly known as Fixnums.
Thin wrapper to ruby/config.h.
unsigned long rb_fix2uint(VALUE)
unsigned long rb_num2uint(VALUE)
Arithmetic conversion between C's intptr_t and Ruby's.
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
Arithmetic conversion between C's long and Ruby's.
Defines enum ruby_special_consts.
Defines RBIMPL_WARNING_PUSH.