update swig on windows
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
SRCS =
|
||||
|
||||
include $(SRCDIR)../example.mk
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "example",
|
||||
"sources": [ "example_wrap.cxx" ],
|
||||
"include_dirs": ["$srcdir"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#define ICONST 42
|
||||
#define FCONST 2.1828
|
||||
#define CCONST 'x'
|
||||
#define CCONST2 '\n'
|
||||
#define SCONST "Hello World"
|
||||
#define SCONST2 "\"Hello World\""
|
||||
#define EXTERN extern
|
||||
#define FOO (ICONST + BAR)
|
||||
@@ -0,0 +1,24 @@
|
||||
/* File : example.i */
|
||||
%module example
|
||||
|
||||
/* A few preprocessor macros */
|
||||
|
||||
#define ICONST 42
|
||||
#define FCONST 2.1828
|
||||
#define CCONST 'x'
|
||||
#define CCONST2 '\n'
|
||||
#define SCONST "Hello World"
|
||||
#define SCONST2 "\"Hello World\""
|
||||
|
||||
/* This should work just fine */
|
||||
#define EXPR ICONST + 3*(FCONST)
|
||||
|
||||
/* This shouldn't do anything */
|
||||
#define EXTERN extern
|
||||
|
||||
/* Neither should this (BAR isn't defined) */
|
||||
#define FOO (ICONST + BAR)
|
||||
|
||||
/* The following directives also produce constants */
|
||||
%constant int iconst = 37;
|
||||
%constant double fconst = 3.14;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require("build/Release/example");
|
||||
@@ -0,0 +1,14 @@
|
||||
var example = require("example");
|
||||
|
||||
console.log("ICONST = " + example.ICONST + " (should be 42)");
|
||||
console.log("FCONST = " + example.FCONST + " (should be 2.1828)");
|
||||
console.log("CCONST = " + example.CCONST + " (should be 'x')");
|
||||
console.log("CCONST2 = " + example.CCONST2 + " (this should be on a new line)");
|
||||
console.log("SCONST = " + example.SCONST + " (should be 'Hello World')");
|
||||
console.log("SCONST2 = " + example.SCONST2 + " (should be '\"Hello World\"')");
|
||||
console.log("EXPR = " + example.EXPR + " (should be 48.5484)");
|
||||
console.log("iconst = " + example.iconst + " (should be 37)");
|
||||
console.log("fconst = " + example.fconst + " (should be 3.14)");
|
||||
|
||||
console.log("EXTERN = " + example.EXTERN + " (should be undefined)");
|
||||
console.log("FOO = " + example.FOO + " (should be undefined)");
|
||||
Reference in New Issue
Block a user