Skip to content

Commit

Permalink
mraajs.i: use SWIG_V8_VERSION from C++ preprocessor not swig
Browse files Browse the repository at this point in the history
SWIG's preprocessor will not handle the SWIG_V8_VERSION these will go in the
wrapper code so that someone compiling with npm will use his version of node

Signed-off-by: Brendan Le Foll <[email protected]>
  • Loading branch information
arfoll committed Mar 19, 2015
1 parent 54a4a0b commit 35d1dc1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/javascript/mraajs.i
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ namespace mraa {
class Spi;
%typemap(out) uint8_t*
{
#if V8_VERSION > 0x032872
%#if SWIG_V8_VERSION > 0x032872
$result = node::Buffer::New((char*) $1, arg3);
#else
%#else
$result = node::Buffer::New((char*) $1, arg3)->handle_;
#endif
%#endif
}
}

Expand All @@ -59,11 +59,11 @@ class Spi;
SWIG_exception_fail(SWIG_ERROR, "I2c write failed");
SWIGV8_RETURN(SWIGV8_UNDEFINED());
}
#if V8_VERSION > 0x032872
%#if SWIG_V8_VERSION > 0x032872
$result = node::Buffer::New((char*) $1, result);
#else
%#else
$result = node::Buffer::New((char*) $1, result)->handle_;
#endif
%#endif
free($1);
}

Expand Down

0 comments on commit 35d1dc1

Please sign in to comment.