mraajs.i: use SWIG_V8_VERSION from C++ preprocessor not swig
authorBrendan Le Foll <brendan.le.foll@intel.com>
Thu, 19 Mar 2015 18:18:35 +0000 (18:18 +0000)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Thu, 19 Mar 2015 18:26:06 +0000 (18:26 +0000)
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 <brendan.le.foll@intel.com>
src/javascript/mraajs.i

index caf64fb..d6ac158 100644 (file)
@@ -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
 }
 }
 
@@ -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);
 }