Files
MINGW-packages/mingw-w64-nodejs/0008-Link-with-municode-and-extern-wmain-for-Unicode.patch
Johannes Schindelin 87a0b47b97 Upgrade node.js to v8.11.1 (#3646)
* nodejs: re-generate patchset

Git's `format-patch` now uses a narrower diffstat, longer abbreviated
hashes in the index lines, and a different Git version, of course.

Besides, the patches started out as an 11-strong patch series (and is
now 13-strong, which is reflected in the [PATCH k/13] prefix of the
Subject: lines), and the 12th patch even lacked attribution and a commit
message.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

* nodejs: adjust patches for v6.14.1

The code base changed enough that some patches are obsolete, and others
need to be applied to a different file, yet others simply do not apply
cleanly.

Note: this does not yet allow building v6.14.1, but *only* adjusts the
existing patches as required, for ease of reviewing.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

* nodejs: do not link to the shared (stale) libuv

Node.js v6.14.1 relies on libuv to be up to date. In particular, it
requires the uv_os_getppid() function to be available.

The version of libuv shipped in MSYS2 is too old and does not provide
that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

* nodejs: update to v6.14.1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

* nodejs: prepare for packaging v6.14.1

Long path problems...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

* nodejs: adjust patches for v8.11.1

Sadly, v6.14.1 would not be able to package because of too-long paths
inside npm's nested node_modules/ directories.

Let's hope that v8.11.1 works better.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

* nodejs: prepare for v8.11.1

It needs quite a bit more patching.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

* mingw-w64-nodejs: upgrade to v8.11.1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-04-29 10:35:19 +03:00

66 lines
1.8 KiB
Diff

From 3b353a4dbc0e96a35d18dde94a787945f1c5c58a Mon Sep 17 00:00:00 2001
From: Alethea Rose <alethea@alethearose.com>
Date: Wed, 15 Feb 2017 19:11:53 -0500
Subject: [PATCH 08/23] Link with -municode and extern wmain for Unicode
---
node.gyp | 6 ++++--
src/node_main.cc | 9 +++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/node.gyp b/node.gyp
index dba17e28..aa6e0588 100644
--- a/node.gyp
+++ b/node.gyp
@@ -347,8 +347,9 @@
# we need to use node's preferred "win32" rather than gyp's preferred "win"
'NODE_PLATFORM="win32"',
'_UNICODE=1',
+ 'UNICODE',
],
- 'libraries': [ '-lpsapi' ]
+ 'libraries': [ '-municode', '-lpsapi' ]
}, { # POSIX
'defines': [ '__POSIX__' ],
'sources': [ 'src/backtrace_posix.cc' ],
@@ -808,7 +809,8 @@
'<(SHARED_INTERMEDIATE_DIR)', # for node_natives.h
],
- 'defines': [ 'NODE_WANT_INTERNALS=1' ],
+ 'defines': [ 'NODE_WANT_INTERNALS=1', '_UNICODE=1', 'UNICODE' ],
+ 'libraries': [ '-municode' ],
'sources': [
'test/cctest/node_module_reg.cc',
diff --git a/src/node_main.cc b/src/node_main.cc
index 2a511b92..d592a1f8 100644
--- a/src/node_main.cc
+++ b/src/node_main.cc
@@ -27,6 +27,10 @@
#include <VersionHelpers.h>
#include <WinError.h>
+#if defined(__MINGW_VERSION_MAJOR)
+#extern "C" {
+#endif
+
int wmain(int argc, wchar_t *wargv[]) {
if (!IsWindows7OrGreater()) {
fprintf(stderr, "This application is only supported on Windows 7, "
@@ -71,6 +75,11 @@ int wmain(int argc, wchar_t *wargv[]) {
// Now that conversion is done, we can finally start.
return node::Start(argc, argv);
}
+
+#if defined(__MINGW_VERSION_MAJOR)
+}
+#endif
+
#else
// UNIX
#ifdef __linux__
--
2.17.0.windows.1