src: do not use posix feature macro in node.h

This macro is only defined when building Node.js, so addons cannot
use it as a way of detecting feature availability.

PR-URL: https://github.com/nodejs/node/pull/27775
Refs: https://github.com/nodejs/node/pull/27246
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Anna Henningsen 2019-05-20 01:55:27 +02:00
parent 282e2f669c
commit e6b3ec3d3c
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -66,9 +66,11 @@
#include <memory>
#ifdef __POSIX__
// We cannot use __POSIX__ in this header because that's only defined when
// building Node.js.
#ifndef _WIN32
#include <signal.h>
#endif // __POSIX__
#endif // _WIN32
#define NODE_MAKE_VERSION(major, minor, patch) \
((major) * 0x1000 + (minor) * 0x100 + (patch))
@ -812,7 +814,7 @@ class NODE_EXTERN AsyncResource {
async_context async_context_;
};
#ifdef __POSIX__
#ifndef _WIN32
// Register a signal handler without interrupting
// any handlers that node itself needs.
NODE_EXTERN
@ -821,7 +823,7 @@ void RegisterSignalHandler(int signal,
siginfo_t* info,
void* ucontext),
bool reset_handler = false);
#endif // __POSIX__
#endif // _WIN32
} // namespace node