Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify the FFI library, apply to loongson platform #421

Open
wants to merge 29 commits into
base: gh-241
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3b09d1a
test: remove semis
TooTallNate Sep 19, 2015
1187b80
test: add case for allowing Buffer backing store for "string" FFI arg…
TooTallNate Sep 19, 2015
c2e5996
test: remove .only()
TooTallNate Sep 19, 2015
3d673ca
test: attempt to fix test 169 on Linux
TooTallNate Sep 19, 2015
9cc5586
test: fix comment
TooTallNate Sep 23, 2015
979da99
test: fix hardcoded `strtoul()` bindings
TooTallNate Sep 24, 2015
829d7da
travis: attempt to test "osx"
TooTallNate Sep 29, 2015
c81ab1e
test: load `Cocoa` lib for Obj-C tests
TooTallNate Sep 29, 2015
529ea78
travis: remove iojs v3
TooTallNate Sep 29, 2015
f5e445b
test: load Foundation first instead
TooTallNate Sep 29, 2015
b6e8dba
remove benchmark files
TooTallNate Nov 14, 2015
819c664
appveyor, travis: test node v5.1
TooTallNate Nov 17, 2015
f0547a7
test: use full URL to issue
TooTallNate Sep 29, 2015
37dc33f
Move `errno` method implement to C++ side
d3m3vilurr Aug 3, 2016
424d6b2
test node v6 with CI
TooTallNate Aug 3, 2016
a66fb8b
rename History.md to CHANGELOG.md
TooTallNate Aug 3, 2016
c95a42e
Release 2.1.0
TooTallNate Aug 3, 2016
8fc355f
add libffi `version` string
TooTallNate Aug 3, 2016
7a928f3
test: add a test case for TooTallNate/ref#56
TooTallNate Oct 13, 2016
97d7ab1
remove OS X 10.5 deployment target
TooTallNate Oct 29, 2016
67aa2c3
Release 2.2.0
TooTallNate Oct 29, 2016
6048e68
drop node v2, add v7
TooTallNate Apr 27, 2017
811ad02
Support Node.js 9.x (#439)
zhaoda Dec 1, 2017
60282c2
travis: drop Node 0.10 and 0.12, add Node 8 and 9
TooTallNate Dec 1, 2017
169773d
test: add nodejs_version for node v8 (#431)
waitingsong Jun 13, 2018
6221b31
2.3.0
TooTallNate Dec 15, 2018
04ec777
Test Node 6, 8, 10 and 11
TooTallNate Dec 18, 2018
4fd9854
README: clarify use of acronym (#510)
gdennie Jan 11, 2019
d9b843c
Upgrade `nan` to v2.12.0 (#523)
lxe Jan 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 13 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
os:
- linux
- osx
sudo: false

env:
- CXX=g++-4.8
language: cpp
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8

language: node_js

node_js:
- "0.10"
- "0.12"
- "2"
- "3.2"
- "4.1"
env:
matrix:
- TRAVIS_NODE_VERSION="6"
- TRAVIS_NODE_VERSION="8"
- TRAVIS_NODE_VERSION="10"
- TRAVIS_NODE_VERSION="11"

install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
- $CXX --version
- PATH="`npm bin`:`npm bin -g`:$PATH"
# Node 0.8 comes with a too obsolete npm
- if [[ "`node --version`" =~ ^v0\.8\. ]]; then npm install -g npm@1.4.28 ; fi
# Install dependencies and build
- npm install

Expand Down
32 changes: 32 additions & 0 deletions History.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
2.2.0 / 2016-10-29
==================

* [[`8fc355f276`](https://github.com/node-ffi/ffi/commit/8fc355f276)] - add libffi `version` string (Nathan Rajlich)
* [[`97d7ab12e6`](https://github.com/node-ffi/ffi/commit/97d7ab12e6)] - remove OS X 10.5 deployment target (Nathan Rajlich)
* [[`7a928f38b1`](https://github.com/node-ffi/ffi/commit/7a928f38b1)] - **test**: add a test case for [TooTallNate/ref#56](https://github.com/TooTallNate/ref/issues/56) (Nathan Rajlich)

2.1.0 / 2016-08-03
==================

* [[`a66fb8b282`](https://github.com/node-ffi/ffi/commit/a66fb8b282)] - rename History.md to CHANGELOG.md (Nathan Rajlich)
* [[`424d6b2278`](https://github.com/node-ffi/ffi/commit/424d6b2278)] - test node v6 with CI (Nathan Rajlich)
* [[`37dc33f10d`](https://github.com/node-ffi/ffi/commit/37dc33f10d)] - Move `errno` method implement to C++ side (Lee, SungUk)
* [[`f0547a7535`](https://github.com/node-ffi/ffi/commit/f0547a7535)] - **test**: use full URL to issue (Nathan Rajlich)
* [[`819c664605`](https://github.com/node-ffi/ffi/commit/819c664605)] - **appveyor, travis**: test node v5.1 (Nathan Rajlich)
* [[`b6e8dba046`](https://github.com/node-ffi/ffi/commit/b6e8dba046)] - remove benchmark files (Nathan Rajlich)
* [[`f5e445be91`](https://github.com/node-ffi/ffi/commit/f5e445be91)] - **test**: load Foundation first instead (Nathan Rajlich)
* [[`529ea78029`](https://github.com/node-ffi/ffi/commit/529ea78029)] - **travis**: remove iojs v3 (Nathan Rajlich)
* [[`c81ab1ed1e`](https://github.com/node-ffi/ffi/commit/c81ab1ed1e)] - **test**: load `Cocoa` lib for Obj-C tests (Nathan Rajlich)
* [[`829d7dac02`](https://github.com/node-ffi/ffi/commit/829d7dac02)] - **travis**: attempt to test "osx" (Nathan Rajlich)
* [[`979da99892`](https://github.com/node-ffi/ffi/commit/979da99892)] - **test**: fix hardcoded `strtoul()` bindings (Nathan Rajlich)
* [[`9cc558632c`](https://github.com/node-ffi/ffi/commit/9cc558632c)] - **test**: fix comment (Nathan Rajlich)
* [[`3d673ca2a1`](https://github.com/node-ffi/ffi/commit/3d673ca2a1)] - **test**: attempt to fix test 169 on Linux (Nathan Rajlich)
* [[`c2e5996d9d`](https://github.com/node-ffi/ffi/commit/c2e5996d9d)] - **test**: remove .only() (Nathan Rajlich)
* [[`1187b80f7b`](https://github.com/node-ffi/ffi/commit/1187b80f7b)] - **test**: add case for allowing Buffer backing store for "string" FFI argument (Nathan Rajlich)
* [[`3b09d1ac09`](https://github.com/node-ffi/ffi/commit/3b09d1ac09)] - **test**: remove semis (Nathan Rajlich)
* [[`74e29a17d0`](https://github.com/node-ffi/ffi/commit/74e29a17d0)] - **test**: whitespace fixes (Nathan Rajlich)
* [[`6551d4ab5b`](https://github.com/node-ffi/ffi/commit/6551d4ab5b)] - **appveyor**: test node v4.1 (Nathan Rajlich)
* [[`c0b64413fe`](https://github.com/node-ffi/ffi/commit/c0b64413fe)] - **travis**: test node v4.1 (Nathan Rajlich)
* [[`730bd4a92f`](https://github.com/node-ffi/ffi/commit/730bd4a92f)] - **travis**: drop "iojs-" prefix from version names (Nathan Rajlich)
* [[`0324f3be9c`](https://github.com/node-ffi/ffi/commit/0324f3be9c)] - test node v0.4 (Nathan Rajlich)
* [[`f3e393bb55`](https://github.com/node-ffi/ffi/commit/f3e393bb55)] - remove node v0.8 from testing matrices (Nathan Rajlich)

2.0.0 / 2015-09-04
==================
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ V8 and 64-bit Types

Internally, V8 stores integers that will fit into a 32-bit space in a 32-bit
integer, and those that fall outside of this get put into double-precision
floating point numbers. This is problematic because FP numbers are imprecise.
floating point (FP) numbers. This is problematic because FP numbers are imprecise.
To get around this, the methods in node-ffi that deal with 64-bit integers return
strings and can accept strings as parameters.

Expand Down
11 changes: 4 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ environment:
MSVS_VERSION: 2013
# Test against these versions of Node.js and io.js
matrix:
# node.js
- nodejs_version: "0.10"
- nodejs_version: "0.12"
# io.js
- nodejs_version: "2"
- nodejs_version: "3.2"
- nodejs_version: "4.1"
- nodejs_version: "6"
- nodejs_version: "8"
- nodejs_version: "10"
- nodejs_version: "11"

platform:
- x86
Expand Down
1 change: 0 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
['OS=="mac"', {
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'MACOSX_DEPLOYMENT_TARGET': '10.5',
'OTHER_CFLAGS': [
'-ObjC++'
]
Expand Down
41 changes: 0 additions & 41 deletions doc/benchmark.js

This file was deleted.

10 changes: 0 additions & 10 deletions doc/benchmark.txt

This file was deleted.

36 changes: 10 additions & 26 deletions lib/errno.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,21 @@

/**
* Implementation of errno. This is a #define :/
* On Linux, it's a global variable with the symbol `errno`,
* On Darwin it's a method execution called `__error`.
* On Windows it's a method execution called `_errno`.
*/

/**
* Module dependencies.
*/

var DynamicLibrary = require('./dynamic_library')
, ForeignFunction = require('./foreign_function')
, bindings = require('./bindings')
, funcs = bindings.StaticFunctions
, ref = require('ref')
, errnoPtr = null
, int = ref.types.int
, intPtr = ref.refType(int)
, errno = null

if (process.platform == 'darwin' || process.platform == 'mac') {
var __error = DynamicLibrary().get('__error')
errnoPtr = ForeignFunction(__error, intPtr, [])
} else if (process.platform == 'win32') {
if (process.platform == 'win32') {
var _errno = DynamicLibrary('msvcrt.dll').get('_errno')
errnoPtr = ForeignFunction(_errno, intPtr, [])
} else { // linux, sunos, etc.
var errnoGlobal = DynamicLibrary().get('errno').reinterpret(int.size)
errnoPtr = function () { return errnoGlobal }
// set the errno type
errnoGlobal.type = int
var errnoPtr = ForeignFunction(_errno, intPtr, [])
errno = function() {
return errnoPtr().deref()
}
} else {
errno = ForeignFunction(funcs._errno, 'int', [])
}


function errno () {
return errnoPtr().deref()
}
module.exports = errno
1 change: 1 addition & 0 deletions lib/ffi.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ switch (ref.sizeof.long) {
exports.types = ref.types

// Include our other modules
exports.version = bindings.version
exports.CIF = require('./cif')
exports.CIF_var = require('./cif_var')
exports.Function = require('./function')
Expand Down