Skip to content

Commit f585a05

Browse files
KaiepiTooTallNate
authored andcommitted
Implement support for wchar_t (#102)
1 parent 924437f commit f585a05

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/ref.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1148,9 +1148,15 @@ Object.defineProperty(types, 'Utf8String', {
11481148
* @name size_t
11491149
*/
11501150

1151+
/**
1152+
* The `wchar_t` type.
1153+
*
1154+
* @name wchar_t
1155+
*/
1156+
11511157
// "typedef"s for the variable-sized types
11521158
;[ 'bool', 'byte', 'char', 'uchar', 'short', 'ushort', 'int', 'uint', 'long'
1153-
, 'ulong', 'longlong', 'ulonglong', 'size_t' ].forEach(function (name) {
1159+
, 'ulong', 'longlong', 'ulonglong', 'size_t', 'wchar_t' ].forEach(function (name) {
11541160
var unsigned = name === 'bool'
11551161
|| name === 'byte'
11561162
|| name === 'size_t'

src/binding.cc

+2
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ NAN_MODULE_INIT(init) {
604604
SET_SIZEOF(ulonglong, unsigned long long);
605605
SET_SIZEOF(pointer, char *);
606606
SET_SIZEOF(size_t, size_t);
607+
SET_SIZEOF(wchar_t, wchar_t);
607608
// size of a Persistent handle to a JS object
608609
SET_SIZEOF(Object, Nan::Persistent<Object>);
609610

@@ -635,6 +636,7 @@ NAN_MODULE_INIT(init) {
635636
SET_ALIGNOF(ulonglong, unsigned long long);
636637
SET_ALIGNOF(pointer, char *);
637638
SET_ALIGNOF(size_t, size_t);
639+
SET_ALIGNOF(wchar_t, wchar_t);
638640
SET_ALIGNOF(Object, Nan::Persistent<Object>);
639641

640642
// exports

0 commit comments

Comments
 (0)