Ruby: parser_value.h Source File

Ruby 3.4.5p51 (2025-07-16 revision 20cda200d3ce092571d0b5d342dadca69636cb0f)

parser_value.h
1#ifndef EXTERNAL_VALUE_H
2#define EXTERNAL_VALUE_H
3
4#include "ruby/config.h"
5
6#if defined(__DOXYGEN__)
7
19typedef uintptr_t VALUE;
20
31typedef uintptr_t ID;
32
42typedef intptr_t SIGNED_VALUE;
43
48#define SIZEOF_VALUE SIZEOF_UINTPTR_T
49
55#define RBIMPL_VALUE_NULL UINTPTR_C(0)
56
62#define RBIMPL_VALUE_ONE UINTPTR_C(1)
63
69#define RBIMPL_VALUE_FULL UINTPTR_MAX
70
71#elif defined HAVE_UINTPTR_T && 0
72typedef uintptr_t VALUE;
73typedef uintptr_t ID;
74# define SIGNED_VALUE intptr_t
75# define SIZEOF_VALUE SIZEOF_UINTPTR_T
76# undef PRI_VALUE_PREFIX
77# define RBIMPL_VALUE_NULL UINTPTR_C(0)
78# define RBIMPL_VALUE_ONE UINTPTR_C(1)
79# define RBIMPL_VALUE_FULL UINTPTR_MAX
80
81#elif SIZEOF_LONG == SIZEOF_VOIDP
82typedef unsigned long VALUE;
83typedef unsigned long ID;
84# define SIGNED_VALUE long
85# define SIZEOF_VALUE SIZEOF_LONG
86# define PRI_VALUE_PREFIX "l"
87# define RBIMPL_VALUE_NULL 0UL
88# define RBIMPL_VALUE_ONE 1UL
89# define RBIMPL_VALUE_FULL ULONG_MAX
90
91#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
92typedef unsigned LONG_LONG VALUE;
93typedef unsigned LONG_LONG ID;
94# define SIGNED_VALUE LONG_LONG
95# define LONG_LONG_VALUE 1
96# define SIZEOF_VALUE SIZEOF_LONG_LONG
97# define PRI_VALUE_PREFIX PRI_LL_PREFIX
98# define RBIMPL_VALUE_NULL 0ULL
99# define RBIMPL_VALUE_ONE 1ULL
100# define RBIMPL_VALUE_FULL ULLONG_MAX
101
102#else
103# error ---->> ruby requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<----
104#endif
105
106#endif /* EXTERNAL_VALUE_H */
LONG_LONG
#define LONG_LONG
Definition long_long.h:38
SIGNED_VALUE
intptr_t SIGNED_VALUE
A signed integer type that has the same width with VALUE.
Definition value.h:63
ID
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
Definition value.h:52
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40