Skip to content
This repository
Browse code

expose the 'size_t' type.

  • Loading branch information...
commit 5d82798be9d67a314d694de500e1a6a65084eb97 1 parent ddba83d
Wade Simmons wadey authored

Showing 3 changed files with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +1 0  README.md
  2. +2 1  lib/ffi.js
  3. +3 0  test/test.js
1  README.md
Source Rendered
@@ -65,6 +65,7 @@ In addition to the basic types, there are type aliases for common C types.
65 65 ulong unsigned long
66 66 longlong long long
67 67 ulonglong unsigned long long
  68 + size_t unsigned int (size is platform-dependent)
68 69
69 70 # LICENSE
70 71
3  lib/ffi.js
@@ -48,7 +48,8 @@ FFI.NON_SPECIFIC_TYPES = {
48 48 "long": "Long",
49 49 "ulong": "ULong",
50 50 "longlong": "LongLong",
51   - "ulonglong": "ULongLong"
  51 + "ulonglong": "ULongLong",
  52 + "size_t": "SizeT"
52 53 };
53 54
54 55 // The initial buffer size of string arguments
3  test/test.js
@@ -103,6 +103,9 @@ assert.equal(16, ptr.getLongLong());
103 103 ptr.putULongLong(17);
104 104 assert.equal(17, ptr.getULongLong());
105 105
  106 +ptr.putSizeT(18);
  107 +assert.equal(18, ptr.getSizeT());
  108 +
106 109 //////////////////////
107 110
108 111 var nullptr = new Pointer(0);

0 comments on commit 5d82798

Please sign in to comment.
Something went wrong with that request. Please try again.