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:
parent
282e2f669c
commit
e6b3ec3d3c
10
src/node.h
10
src/node.h
@ -66,9 +66,11 @@
|
|||||||
|
|
||||||
#include <memory>
|
#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>
|
#include <signal.h>
|
||||||
#endif // __POSIX__
|
#endif // _WIN32
|
||||||
|
|
||||||
#define NODE_MAKE_VERSION(major, minor, patch) \
|
#define NODE_MAKE_VERSION(major, minor, patch) \
|
||||||
((major) * 0x1000 + (minor) * 0x100 + (patch))
|
((major) * 0x1000 + (minor) * 0x100 + (patch))
|
||||||
@ -812,7 +814,7 @@ class NODE_EXTERN AsyncResource {
|
|||||||
async_context async_context_;
|
async_context async_context_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __POSIX__
|
#ifndef _WIN32
|
||||||
// Register a signal handler without interrupting
|
// Register a signal handler without interrupting
|
||||||
// any handlers that node itself needs.
|
// any handlers that node itself needs.
|
||||||
NODE_EXTERN
|
NODE_EXTERN
|
||||||
@ -821,7 +823,7 @@ void RegisterSignalHandler(int signal,
|
|||||||
siginfo_t* info,
|
siginfo_t* info,
|
||||||
void* ucontext),
|
void* ucontext),
|
||||||
bool reset_handler = false);
|
bool reset_handler = false);
|
||||||
#endif // __POSIX__
|
#endif // _WIN32
|
||||||
|
|
||||||
} // namespace node
|
} // namespace node
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user