Ruby: include/ruby/internal/arithmetic/long_long.h Source File

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

long_long.h
Go to the documentation of this file.
1#ifndef RBIMPL_ARITHMETIC_LONG_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_ARITHMETIC_LONG_LONG_H
23#include "ruby/internal/value.h"
24#include "ruby/internal/dllexport.h"
25#include "ruby/internal/special_consts.h"
26#include "ruby/backward/2/long_long.h"
27
28#define RB_LL2NUM rb_ll2inum
29#define RB_ULL2NUM rb_ull2inum
30#define LL2NUM RB_LL2NUM
31#define ULL2NUM RB_ULL2NUM
32#define RB_NUM2LL rb_num2ll_inline
33#define RB_NUM2ULL rb_num2ull
34#define NUM2LL RB_NUM2LL
35#define NUM2ULL RB_NUM2ULL
36
37 RBIMPL_SYMBOL_EXPORT_BEGIN()
38 VALUE rb_ll2inum(LONG_LONG);
39 VALUE rb_ull2inum(unsigned LONG_LONG);
40LONG_LONG rb_num2ll(VALUE);
41 unsigned LONG_LONG rb_num2ull(VALUE);
42 RBIMPL_SYMBOL_EXPORT_END()
43
44static inline LONG_LONG
45rb_num2ll_inline(VALUE x)
46{
47 if (RB_FIXNUM_P(x))
48 return RB_FIX2LONG(x);
49 else
50 return rb_num2ll(x);
51}
52
53#endif /* RBIMPL_ARITHMETIC_LONG_LONG_H */
long_long.h
Defines old #LONG_LONG.
dllexport.h
Tewaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:86
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:77
rb_ll2inum
VALUE rb_ll2inum(LONG_LONG)
rb_num2ull
unsigned LONG_LONG rb_num2ull(VALUE)
rb_ull2inum
VALUE rb_ull2inum(unsigned LONG_LONG)
rb_num2ll
LONG_LONG rb_num2ll(VALUE)
RB_FIX2LONG
#define RB_FIX2LONG
Definition: long.h:53
special_consts.h
Defines enum ruby_special_consts.
value.h
Defines VALUE and ID.
VALUE
unsigned long VALUE
Definition: value.h:38