1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add RB_ prefix for size_t to number conversion.

This commit is contained in:
Samuel Williams 2020-08-26 09:06:09 +12:00
parent 40c06e6fe1
commit c12b2703bc
Notes: git 2020-09-06 12:38:20 +09:00

View file

@ -27,25 +27,30 @@
#include "ruby/backward/2/long_long.h"
#if SIZEOF_SIZE_T == SIZEOF_LONG_LONG
# define SIZET2NUM RB_ULL2NUM
# define SSIZET2NUM RB_LL2NUM
# define RB_SIZE2NUM RB_ULL2NUM
# define RB_SSIZE2NUM RB_LL2NUM
#elif SIZEOF_SIZE_T == SIZEOF_LONG
# define SIZET2NUM RB_ULONG2NUM
# define SSIZET2NUM RB_LONG2NUM
# define RB_SIZE2NUM RB_ULONG2NUM
# define RB_SSIZE2NUM RB_LONG2NUM
#else
# define SIZET2NUM RB_UINT2NUM
# define SSIZET2NUM RB_INT2NUM
# define RB_SIZE2NUM RB_UINT2NUM
# define RB_SSIZE2NUM RB_INT2NUM
#endif
#if SIZEOF_SIZE_T == SIZEOF_LONG_LONG
# define NUM2SIZET RB_NUM2ULL
# define NUM2SSIZET RB_NUM2LL
# define RB_NUM2SIZE RB_NUM2ULL
# define RB_NUM2SSIZE RB_NUM2LL
#elif SIZEOF_SIZE_T == SIZEOF_LONG
# define NUM2SIZET RB_NUM2ULONG
# define NUM2SSIZET RB_NUM2LONG
# define RB_NUM2SIZE RB_NUM2ULONG
# define RB_NUM2SSIZE RB_NUM2LONG
#else
# define NUM2SIZET RB_NUM2UINT
# define NUM2SSIZET RB_NUM2INT
# define RB_NUM2SIZE RB_NUM2UINT
# define RB_NUM2SSIZE RB_NUM2INT
#endif
#define NUM2SIZET RB_NUM2SIZE
#define SIZET2NUM RB_SIZE2NUM
#define NUM2SSIZET RB_NUM2SSIZE
#define SSIZET2NUM RB_SSIZE2NUM
#endif /* RBIMPL_ARITHMETIC_SIZE_T_H */