diff --git a/src/bufferutil.cc b/src/bufferutil.cc index 3d73a4abc..8d3148666 100644 --- a/src/bufferutil.cc +++ b/src/bufferutil.cc @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -107,6 +108,9 @@ class BufferUtil : public ObjectWrap } }; +#if !NODE_VERSION_AT_LEAST(0,10,0) +extern "C" +#endif void init (Handle target) { NanScope(); diff --git a/src/validation.cc b/src/validation.cc index 62a6e6599..6e48cf2f7 100644 --- a/src/validation.cc +++ b/src/validation.cc @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -134,7 +135,9 @@ class Validation : public ObjectWrap NanReturnValue(is_valid_utf8(buffer_length, buffer_data) == 1 ? NanTrue() : NanFalse()); } }; - +#if !NODE_VERSION_AT_LEAST(0,10,0) +extern "C" +#endif void init (Handle target) { NanScope();