Browse Source

Implement `process.arch` to get a String of the current processor architecture, with docs.

v0.7.4-release
Nathan Rajlich 14 years ago
committed by isaacs
parent
commit
b1be5409bd
  1. 7
      doc/api/process.markdown
  2. 3
      src/node.cc
  3. 3
      wscript

7
doc/api/process.markdown

@ -271,6 +271,13 @@ The PID of the process.
Getter/setter to set what is displayed in 'ps'. Getter/setter to set what is displayed in 'ps'.
### process.arch
What processor architecture you're running on. `'arm'`, `'ia32'`, etc.
console.log('This processor architecture is ' + process.arch);
### process.platform ### process.platform
What platform you're running on. `'linux2'`, `'darwin'`, etc. What platform you're running on. `'linux2'`, `'darwin'`, etc.

3
src/node.cc

@ -1992,6 +1992,9 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
// process.arch
process->Set(String::NewSymbol("arch"), String::New(ARCH));
// process.platform // process.platform
process->Set(String::NewSymbol("platform"), String::New(PLATFORM)); process->Set(String::NewSymbol("platform"), String::New(PLATFORM));

3
wscript

@ -501,6 +501,9 @@ def configure(conf):
else: else:
conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=0') conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=0')
# arch
conf.env.append_value('CPPFLAGS', '-DARCH="' + conf.env['DEST_CPU'] + '"')
# platform # platform
conf.env.append_value('CPPFLAGS', '-DPLATFORM="' + conf.env['DEST_OS'] + '"') conf.env.append_value('CPPFLAGS', '-DPLATFORM="' + conf.env['DEST_OS'] + '"')

Loading…
Cancel
Save