mirror of https://github.com/nodejs/node.git
src: wrap macros in `do {...} while (0)`
Wrapped two macros in do {...} while (0) blocks and lined up backslashes. Uses up semicolon in contexts where a dangling semicolon is erroneous.pull/35604/head
parent
2900f0778a
commit
72b92e92d3
|
@ -43,16 +43,19 @@
|
|||
# define OPENSSL_CONST
|
||||
#endif
|
||||
|
||||
#define ASSERT_IS_STRING_OR_BUFFER(val) \
|
||||
if (!Buffer::HasInstance(val) && !val->IsString()) { \
|
||||
return ThrowException(Exception::TypeError(String::New( \
|
||||
"Not a string or buffer"))); \
|
||||
}
|
||||
#define ASSERT_IS_STRING_OR_BUFFER(val) do { \
|
||||
if (!Buffer::HasInstance(val) && !val->IsString()) { \
|
||||
return ThrowException(Exception::TypeError(String::New( \
|
||||
"Not a string or buffer"))); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define ASSERT_IS_BUFFER(val) \
|
||||
if (!Buffer::HasInstance(val)) { \
|
||||
return ThrowException(Exception::TypeError(String::New("Not a buffer"))); \
|
||||
}
|
||||
#define ASSERT_IS_BUFFER(val) do { \
|
||||
if (!Buffer::HasInstance(val)) { \
|
||||
return ThrowException(Exception::TypeError(String::New( \
|
||||
"Not a buffer"))); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static const char PUBLIC_KEY_PFX[] = "-----BEGIN PUBLIC KEY-----";
|
||||
static const int PUBLIC_KEY_PFX_LEN = sizeof(PUBLIC_KEY_PFX) - 1;
|
||||
|
|
Loading…
Reference in New Issue