Browse Source

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.
archived-io.js-v0.12
Ben Noordhuis 10 years ago
parent
commit
b33a87d8cb
  1. 8
      src/node.h
  2. 3
      src/node_v8_platform.cc

8
src/node.h

@ -148,14 +148,6 @@ NODE_EXTERN v8::Handle<v8::Value> MakeCallback(
#define NODE_STRINGIFY_HELPER(n) #n #define NODE_STRINGIFY_HELPER(n) #n
#endif #endif
#ifndef STATIC_ASSERT
#if defined(_MSC_VER)
# define STATIC_ASSERT(expr) static_assert(expr, "")
# else
# define STATIC_ASSERT(expr) static_cast<void>((sizeof(char[-1 + !!(expr)])))
# endif
#endif
#ifdef _WIN32 #ifdef _WIN32
// TODO(tjfontaine) consider changing the usage of ssize_t to ptrdiff_t // TODO(tjfontaine) consider changing the usage of ssize_t to ptrdiff_t
#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)

3
src/node_v8_platform.cc

@ -101,7 +101,8 @@ void Platform::WorkerBody(void* arg) {
TaskQueue::TaskQueue() { TaskQueue::TaskQueue() {
int err; int err;
STATIC_ASSERT(kRingSize == (kRingSize & (~(kRingSize - 1)))); static_assert(kRingSize == (kRingSize & (~(kRingSize - 1))),
"kRingSize is not a power of two");
size_ = kRingSize; size_ = kRingSize;
ring_ = new Task*[size_]; ring_ = new Task*[size_];

Loading…
Cancel
Save