Permalink
Browse files

Move ARRAY_SIZE macro to node.h

  • Loading branch information...
1 parent cdbecc4 commit 7003d6eff56193aa6f2370cafb7f7bf10db243c7 @bnoordhuis bnoordhuis committed Aug 23, 2011
Showing with 4 additions and 5 deletions.
  1. +0 −2 src/node.cc
  2. +4 −0 src/node.h
  3. +0 −1 src/node_file.cc
  4. +0 −2 src/node_net.cc
View
@@ -100,8 +100,6 @@ extern "C" {
#include <node_script.h>
#include <v8_typed_array.h>
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
-
using namespace v8;
# ifdef __APPLE__
View
@@ -46,6 +46,10 @@
#include <node_object_wrap.h>
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
+#endif
+
#ifndef NODE_STRINGIFY
#define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
#define NODE_STRINGIFY_HELPER(n) #n
View
@@ -69,7 +69,6 @@ namespace node {
using namespace v8;
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define THROW_BAD_ARGS \
ThrowException(Exception::TypeError(String::New("Bad argument")))
View
@@ -83,8 +83,6 @@
# define SHUT_RDWR SD_BOTH
#endif
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
-
namespace node {

0 comments on commit 7003d6e

Please sign in to comment.