Skip to content

Commit

Permalink
Merge pull request #437 from pjump/master
Browse files Browse the repository at this point in the history
Make it work on nodejs v0.8 too
  • Loading branch information
3rd-Eden committed Jan 18, 2015
2 parents f41689d + 56ef891 commit e3b7b8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/bufferutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <v8.h>
#include <node.h>
#include <node_version.h>
#include <node_buffer.h>
#include <node_object_wrap.h>
#include <stdlib.h>
Expand Down Expand Up @@ -107,6 +108,9 @@ class BufferUtil : public ObjectWrap
}
};

#if !NODE_VERSION_AT_LEAST(0,10,0)
extern "C"
#endif
void init (Handle<Object> target)
{
NanScope();
Expand Down
5 changes: 4 additions & 1 deletion src/validation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <v8.h>
#include <node.h>
#include <node_version.h>
#include <node_buffer.h>
#include <node_object_wrap.h>
#include <stdlib.h>
Expand Down Expand Up @@ -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<Object> target)
{
NanScope();
Expand Down

0 comments on commit e3b7b8f

Please sign in to comment.