mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
src: prefix ARCH and PLATFORM with NODE_
The PLATFORM preprocessor symbol is defined in node.gyp, and on Windows
it's set to "win". This conflicts with a built-in preprocessor symbol
with a different value ("win32"), which makes the linker(!) complain.
Resolve this by renaming these symbols to NODE_ARCH and NODE_PLATFORM.
PR-URL: https://github.com/iojs/io.js/pull/261
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
1 parent
858b558345
commit
e1fe270fd7
2 files changed
+12
-7
No files matched your search
@@ -164,11 +164,11 @@
|
|||||||
],
|
],
|
||||||
|
|
||||||
'defines': [
|
'defines': [
|
||||||
'NODE_WANT_INTERNALS=1',
|
'NODE_ARCH="<(target_arch)"',
|
||||||
'ARCH="<(target_arch)"',
|
'NODE_PLATFORM="<(OS)"',
|
||||||
'PLATFORM="<(OS)"',
|
|
||||||
'NODE_TAG="<(node_tag)"',
|
'NODE_TAG="<(node_tag)"',
|
||||||
'NODE_V8_OPTIONS="<(node_v8_options)"',
|
'NODE_V8_OPTIONS="<(node_v8_options)"',
|
||||||
|
'NODE_WANT_INTERNALS=1',
|
||||||
],
|
],
|
||||||
|
|
||||||
'conditions': [
|
'conditions': [
|
||||||
|
|||||||
+9
-4
@@ -2623,12 +2623,17 @@ void SetupProcessObject(Environment* env,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// process.arch
|
// process.arch
|
||||||
READONLY_PROPERTY(process, "arch", OneByteString(env->isolate(), ARCH));
|
READONLY_PROPERTY(process, "arch", OneByteString(env->isolate(), NODE_ARCH));
|
||||||
|
|
||||||
// process.platform
|
// process.platform
|
||||||
READONLY_PROPERTY(process,
|
#ifdef _WIN32
|
||||||
"platform",
|
// As determined by gyp, NODE_PLATFORM equals 'win' on windows. However
|
||||||
OneByteString(env->isolate(), PLATFORM));
|
// for historic reasons process.platform should be 'win32'.
|
||||||
|
Local<String> platform = OneByteString(env->isolate(), "win32");
|
||||||
|
#else
|
||||||
|
Local<String> platform = OneByteString(env->isolate(), NODE_PLATFORM);
|
||||||
|
#endif
|
||||||
|
READONLY_PROPERTY(process, "platform", platform);
|
||||||
|
|
||||||
// process.argv
|
// process.argv
|
||||||
Local<Array> arguments = Array::New(env->isolate(), argc);
|
Local<Array> arguments = Array::New(env->isolate(), argc);
|
||||||
|
|||||||
Reference in new issue
Block a user