From b33a87d8cb52d5ea57fe4ecd1498f3136a2ccc11 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 22 Oct 2014 03:53:57 +0200 Subject: [PATCH] src: remove STATIC_ASSERT() macro This macro does not not rightfully belong in node.h, remove it. Replace the one use site with a C++11 `static_assert` construct. --- src/node.h | 8 -------- src/node_v8_platform.cc | 3 ++- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/node.h b/src/node.h index 384b790c97..8857751b50 100644 --- a/src/node.h +++ b/src/node.h @@ -148,14 +148,6 @@ NODE_EXTERN v8::Handle MakeCallback( #define NODE_STRINGIFY_HELPER(n) #n #endif -#ifndef STATIC_ASSERT -#if defined(_MSC_VER) -# define STATIC_ASSERT(expr) static_assert(expr, "") -# else -# define STATIC_ASSERT(expr) static_cast((sizeof(char[-1 + !!(expr)]))) -# endif -#endif - #ifdef _WIN32 // TODO(tjfontaine) consider changing the usage of ssize_t to ptrdiff_t #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) diff --git a/src/node_v8_platform.cc b/src/node_v8_platform.cc index 20c79ab417..7439382bca 100644 --- a/src/node_v8_platform.cc +++ b/src/node_v8_platform.cc @@ -101,7 +101,8 @@ void Platform::WorkerBody(void* arg) { TaskQueue::TaskQueue() { int err; - STATIC_ASSERT(kRingSize == (kRingSize & (~(kRingSize - 1)))); + static_assert(kRingSize == (kRingSize & (~(kRingSize - 1))), + "kRingSize is not a power of two"); size_ = kRingSize; ring_ = new Task*[size_];