1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00

backport NUM2SIZET and SIZET2NUM macros for 1.8.7

This commit is contained in:
Charles Lowell 2012-06-19 06:43:28 -05:00
parent a2054c6d2b
commit ea061df1de
2 changed files with 15 additions and 8 deletions

View file

@ -1,13 +1,5 @@
#include "rr.h"
#if !defined(SIZET2NUM)
# if SIZEOF_SIZE_T == SIZEOF_LONG
# define SIZET2NUM(n) ULONG2NUM(n)
# else
# define SIZET2NUM(n) ULL2NUM(n)
# endif
#endif /* ! defined(SIZET2NUM) */
namespace rr {
void HeapStatistics::Init() {
ClassBuilder("HeapStatistics").

View file

@ -12,6 +12,21 @@
# define RARRAY_LENINT(v) (int)RARRAY_LEN(v)
#endif /* ! defined(RARRAY_LENINT) */
#if !defined(SIZET2NUM)
# if SIZEOF_SIZE_T == SIZEOF_LONG
# define SIZET2NUM(n) ULONG2NUM(n)
# else
# define SIZET2NUM(n) ULL2NUM(n)
# endif
#endif /* ! defined(SIZET2NUM) */
#if !defined(NUM2SIZET)
# if SIZEOF_SIZE_T == SIZEOF_LONG
# define NUM2SIZET(n) ((size_t)NUM2ULONG(n))
# else
# define NUM2SIZET(n) ((size_t)NUM2ULL(n))
# endif
#endif /* ! defined(NUM2SIZET) */
namespace rr {