Ruby: include/ruby/internal/value.h File Reference

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

Macros | Typedefs | Functions
value.h File Reference

Defines VALUE and ID. More...

`#include "ruby/internal/static_assert.h"`
`#include "ruby/backward/2/long_long.h"`
`#include "ruby/backward/2/limits.h"`

Go to the source code of this file.

## Macros
#define | SIGNED_VALUE long
#define | SIZEOF_VALUE SIZEOF_LONG
#define | PRI_VALUE_PREFIX "l"
#define | RBIMPL_VALUE_NULL 0UL
#define | RBIMPL_VALUE_ONE 1UL
#define | RBIMPL_VALUE_FULL ULONG_MAX

## Typedefs
typedef unsigned long | VALUE
typedef unsigned long | ID

## Functions
| RBIMPL_STATIC_ASSERT (sizeof_int, SIZEOF_INT==sizeof(int))
| RBIMPL_STATIC_ASSERT (sizeof_long, SIZEOF_LONG==sizeof(long))
| RBIMPL_STATIC_ASSERT (sizeof_long_long, SIZEOF_LONG_LONG==sizeof(LONG_LONG))
| RBIMPL_STATIC_ASSERT (sizeof_voidp, SIZEOF_VOIDP==sizeof(void *))

## Detailed Description

Defines VALUE and ID.

Author
  Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

Copyright
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Warning
  Symbols prefixed with either `RBIMPL` or `rbimpl` are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will.

Note
  To ruby-core: remember that this header can be possibly recursively included from extension libraries written in C++. Do not expect for instance `__VA_ARGS__` is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98.

Definition in file value.h.

## Macro Definition Documentation

## ◆ PRI_VALUE_PREFIX

#define PRI_VALUE_PREFIX "l"

Definition at line 42 of file value.h.

## ◆ RBIMPL_VALUE_FULL

#define RBIMPL_VALUE_FULL ULONG_MAX

Definition at line 45 of file value.h.

## ◆ RBIMPL_VALUE_NULL

#define RBIMPL_VALUE_NULL 0UL

Definition at line 43 of file value.h.

## ◆ RBIMPL_VALUE_ONE

#define RBIMPL_VALUE_ONE 1UL

Definition at line 44 of file value.h.

## ◆ SIGNED_VALUE

#define SIGNED_VALUE long

Definition at line 40 of file value.h.

## ◆ SIZEOF_VALUE

#define SIZEOF_VALUE SIZEOF_LONG

Definition at line 41 of file value.h.

## Typedef Documentation

## ◆ ID

typedef unsigned long ID

Definition at line 39 of file value.h.

## ◆ VALUE

typedef unsigned long VALUE

Definition at line 38 of file value.h.

## Function Documentation

## ◆ RBIMPL_STATIC_ASSERT() [1/4]

RBIMPL_STATIC_ASSERT | ( | sizeof_int | ,
|  | SIZEOF_INT | = `=sizeof(int)`
| ) |  |

## ◆ RBIMPL_STATIC_ASSERT() [2/4]

RBIMPL_STATIC_ASSERT | ( | sizeof_long | ,
|  | SIZEOF_LONG | = `=sizeof(long)`
| ) |  |

## ◆ RBIMPL_STATIC_ASSERT() [3/4]

RBIMPL_STATIC_ASSERT | ( | sizeof_long_long | ,
|  | SIZEOF_LONG_LONG | = `=sizeof(LONG_LONG)`
| ) |  |

## ◆ RBIMPL_STATIC_ASSERT() [4/4]

RBIMPL_STATIC_ASSERT | ( | sizeof_voidp | ,
|  | SIZEOF_VOIDP | = `=sizeof(void *)`
| ) |  |