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:
parent
a2054c6d2b
commit
ea061df1de
2 changed files with 15 additions and 8 deletions
|
@ -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").
|
||||
|
|
15
ext/v8/rr.h
15
ext/v8/rr.h
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue