Ruby: ext/rbconfig/sizeof/sizes.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions
sizes.c File Reference
`#include "ruby/ruby.h"`

Go to the source code of this file.

## Macros
#define | DEFINE(type, size) rb_hash_aset(s, rb_str_new_cstr(#type), INT2FIX(SIZEOF_##size))
#define | DEFINE_SIZE(type) rb_hash_aset(s, rb_str_new_cstr(#type), INT2FIX(sizeof(type)))

## Functions
void | Init_limits (void)
void | Init_sizeof (void)

## Macro Definition Documentation

## ◆ DEFINE

#define DEFINE | ( |  | type,
|  |  | size
| ) |  | rb_hash_aset(s, rb_str_new_cstr(#type), INT2FIX(SIZEOF_##size))

## ◆ DEFINE_SIZE

#define DEFINE_SIZE | ( |  | type | ) | rb_hash_aset(s, rb_str_new_cstr(#type), INT2FIX(sizeof(type)))

## Function Documentation

## ◆ Init_limits()

void Init_limits | ( | void |  | ) |

Definition at line 14 of file limits.c.

References DBL2NUM, DBL_DIG, DBL_EPSILON, DBL_MANT_DIG, DBL_MAX, DBL_MAX_10_EXP, DBL_MAX_EXP, DBL_MIN, DBL_MIN_10_EXP, DBL_MIN_EXP, DEFINE, FIXNUM_MAX, FIXNUM_MIN, FLT_RADIX, INTPTR_MAX, INTPTR_MIN, LLONG_MAX, LLONG_MIN, LONG2NUM, LONG_MAX, LONG_MIN, MAX2NUM, MIN2NUM, OBJ_FREEZE, rb_define_const(), rb_define_module(), rb_hash_new(), SIZE, SIZE_MAX, SIZE_MIN, and UINTPTR_MAX.

Referenced by Init_sizeof().

## ◆ Init_sizeof()

void Init_sizeof | ( | void |  | ) |

Definition at line 13 of file sizes.c.

References DEFINE, DEFINE_SIZE, Init_limits(), OBJ_FREEZE, off_t, rb_define_const(), rb_define_module(), and rb_hash_new().