From f953495a65361a9fa86e8c03632d69c02a1d0244 Mon Sep 17 00:00:00 2001 From: Igor Klopov Date: Sun, 17 Jun 2018 19:29:41 +0300 Subject: [PATCH] macos compatibility --- patches/node.v10.4.1.cpp.patch | 10 +++++----- patches/node.v8.11.3.cpp.patch | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/patches/node.v10.4.1.cpp.patch b/patches/node.v10.4.1.cpp.patch index ec042e9..313b5b6 100644 --- a/patches/node.v10.4.1.cpp.patch +++ b/patches/node.v10.4.1.cpp.patch @@ -498,16 +498,16 @@ +} + +bool should_set_dummy() { -+#ifdef __POSIX__ -+ const char* execpath_env = getenv("PKG_EXECPATH"); -+ if (!execpath_env) return true; -+ return strcmp(execpath_env, "PKG_INVOKE_NODEJS") != 0; -+#else ++#ifdef _WIN32 + #define MAX_ENV_LENGTH 32767 + char execpath_env[MAX_ENV_LENGTH]; + DWORD result = GetEnvironmentVariable("PKG_EXECPATH", execpath_env, MAX_ENV_LENGTH); + if (result == 0 && GetLastError() != ERROR_SUCCESS) return true; + return strcmp(execpath_env, "PKG_INVOKE_NODEJS") != 0; ++#else ++ const char* execpath_env = getenv("PKG_EXECPATH"); ++ if (!execpath_env) return true; ++ return strcmp(execpath_env, "PKG_INVOKE_NODEJS") != 0; +#endif +} + diff --git a/patches/node.v8.11.3.cpp.patch b/patches/node.v8.11.3.cpp.patch index 14be9f5..3f39dbc 100644 --- a/patches/node.v8.11.3.cpp.patch +++ b/patches/node.v8.11.3.cpp.patch @@ -436,15 +436,15 @@ } + +bool should_set_dummy() { -+#ifdef __POSIX__ -+ const char* execpath_env = getenv("PKG_EXECPATH"); -+ if (!execpath_env) return true; -+ return strcmp(execpath_env, "PKG_INVOKE_NODEJS") != 0; -+#else ++#ifdef _WIN32 + #define MAX_ENV_LENGTH 32767 + char execpath_env[MAX_ENV_LENGTH]; + DWORD result = GetEnvironmentVariable("PKG_EXECPATH", execpath_env, MAX_ENV_LENGTH); + if (result == 0 && GetLastError() != ERROR_SUCCESS) return true; ++ return strcmp(execpath_env, "PKG_INVOKE_NODEJS") != 0; ++#else ++ const char* execpath_env = getenv("PKG_EXECPATH"); ++ if (!execpath_env) return true; + return strcmp(execpath_env, "PKG_INVOKE_NODEJS") != 0; #endif +}