1#ifndef RBIMPL_ARITHMETIC_LEN_T_H
2#define RBIMPL_ARITHMETIC_LEN_T_H
23#include "ruby/internal/config.h"
26#include "ruby/internal/cast.h"
29#define LEN2NUM RB_LEN2NUM
30#define NUM2LEN RB_NUM2LEN
31#define ULEN2NUM RB_ULEN2NUM
32#define rb_len2int rb_len2int_inline
35#define RB_LEN2NUM RB_LONG2NUM
38#define RB_NUM2LEN RB_NUM2LONG
41#define RB_ULEN2NUM RB_ULONG2NUM
53 int i = RBIMPL_CAST((
int)n);
55 if (
sizeof(
rb_len_t) <=
sizeof(
int)) {
Defines RBIMPL_ASSUME / RBIMPL_UNREACHABLE.
#define RBIMPL_ASSUME(_)
Wraps (or simulates) __builtin_unreachable.
static int rb_len2int_inline(rb_len_t n)
Checks if int can hold the given integer.
Arithmetic conversion between C's long and Ruby's.
void rb_out_of_int(SIGNED_VALUE num)
This is an utility function to raise an rb_eRangeError.
long rb_len_t
A signed integer type for lengths and indices of objects such as String and Array.