Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
short.h
Go to the documentation of this file.
1#ifndef RBIMPL_ARITHMETIC_SHORT_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_ARITHMETIC_SHORT_H
26#include "ruby/internal/value.h"
29
30#define RB_NUM2SHORT rb_num2short_inline
31#define RB_NUM2USHORT rb_num2ushort
32#define NUM2SHORT RB_NUM2SHORT
33#define NUM2USHORT RB_NUM2USHORT
34#define USHORT2NUM RB_INT2FIX
35#define RB_FIX2SHORT rb_fix2short
36#define FIX2SHORT RB_FIX2SHORT
37
39short rb_num2short(VALUE);
40unsigned short rb_num2ushort(VALUE);
41short rb_fix2short(VALUE);
42unsigned short rb_fix2ushort(VALUE);
44
45static inline short
46rb_num2short_inline(VALUE x)
47{
48 if (RB_FIXNUM_P(x))
49 return rb_fix2short(x);
50 else
51 return rb_num2short(x);
52}
53
54#endif /* RBIMPL_ARITHMETIC_SOHRT_H */
Tewaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:86
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:77
unsigned short rb_fix2ushort(VALUE)
Definition: numeric.c:3126
short rb_fix2short(VALUE)
Definition: numeric.c:3107
short rb_num2short(VALUE)
Definition: numeric.c:3098
unsigned short rb_num2ushort(VALUE)
Definition: numeric.c:3116
Defines enum ruby_special_consts.
Defines VALUE and ID.
unsigned long VALUE
Definition: value.h:38