MINGW-packages/mingw-w64-nodejs/0008-Link-with-municode-and-extern-wmain-for-Unicode.patch
2025-07-13 10:57:51 +03:00

59 lines
1.7 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 | 9 +++++++++
node.gypi | 1 +
2 files changed, 10 insertions(+)
diff --git a/node.gyp b/node.gyp
index fc14d6e5..f08fcdf3 100644
--- a/node.gyp
+++ b/node.gyp
@@ -568,6 +568,9 @@
'msvs_disabled_warnings!': [4244],
'conditions': [
+ [ 'OS=="win"', {
+ 'ldflags': [ '-municode' ],
+ }],
[ 'error_on_warn=="true"', {
'cflags': ['-Werror'],
'xcode_settings': {
@@ -1358,6 +1361,9 @@
[ 'OS in "linux mac openharmony"', {
'defines': ['NODE_JS2C_USE_STRING_LITERALS'],
}],
+ [ 'OS=="win"', {
+ 'ldflags': [ '-municode' ],
+ }],
[ 'debug_node=="true"', {
'cflags!': [ '-O3' ],
'cflags': [ '-g', '-O0' ],
@@ -1409,6 +1415,9 @@
['node_write_snapshot_as_array_literals=="true"', {
'defines': [ 'NODE_MKSNAPSHOT_USE_ARRAY_LITERALS=1' ],
}],
+ [ 'OS=="win"', {
+ 'ldflags': [ '-municode' ],
+ }],
[ 'node_use_openssl=="true"', {
'dependencies': [
'deps/ncrypto/ncrypto.gyp:ncrypto',
diff --git a/node.gypi b/node.gypi
index a851fbbc..08d0f492 100644
--- a/node.gypi
+++ b/node.gypi
@@ -67,6 +67,7 @@
'FD_SETSIZE=1024',
# we need to use node's preferred "win32" rather than gyp's preferred "win"
'NODE_PLATFORM="win32"',
+ 'UNICODE',
'_UNICODE=1',
],
'conditions': [
--
2.17.0.windows.1