From e6b3ec3d3c553200fa98ed47dff12d58ebedf8a2 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 20 May 2019 01:55:27 +0200 Subject: [PATCH] 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 Reviewed-By: James M Snell Reviewed-By: Rich Trott --- src/node.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/node.h b/src/node.h index d8f7e3bc57503e..65997fbc7b9e87 100644 --- a/src/node.h +++ b/src/node.h @@ -66,9 +66,11 @@ #include -#ifdef __POSIX__ +// We cannot use __POSIX__ in this header because that's only defined when +// building Node.js. +#ifndef _WIN32 #include -#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