Permalink
Browse files

backport NUM2SIZET and SIZET2NUM macros for 1.8.7

  • Loading branch information...
cowboyd committed Jun 19, 2012
1 parent a2054c6 commit ea061df1de5466770c791a8da3b94cfa08767f70
Showing with 15 additions and 8 deletions.
  1. +0 −8 ext/v8/heap.cc
  2. +15 −0 ext/v8/rr.h
View
@@ -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
@@ -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 {

0 comments on commit ea061df

Please sign in to comment.