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,28 @@
|
||||
#include <iostream>
|
||||
|
||||
void f() {
|
||||
std::cout << "Called f()." << std::endl;
|
||||
}
|
||||
|
||||
void f(int val) {
|
||||
std::cout << "Called f(int)." << std::endl;
|
||||
}
|
||||
void f(int val1, int val2) {
|
||||
std::cout << "Called f(int, int)." << std::endl;
|
||||
}
|
||||
|
||||
void f(const char* s) {
|
||||
std::cout << "Called f(const char*)." << std::endl;
|
||||
}
|
||||
|
||||
void f(bool val) {
|
||||
std::cout << "Called f(bool)." << std::endl;
|
||||
}
|
||||
|
||||
void f(long val) {
|
||||
std::cout << "Called f(long)." << std::endl;
|
||||
}
|
||||
|
||||
void f(double val) {
|
||||
std::cout << "Called f(double)." << std::endl;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/* File : example.i */
|
||||
%module example
|
||||
|
||||
%{
|
||||
#include "example.h"
|
||||
%}
|
||||
|
||||
/*
|
||||
Note: overloading is implemented in a sloppy way currently
|
||||
i.e., only the number of arguments is taken into conideration
|
||||
for dispatching.
|
||||
To solve the problem one has to rename such conflicting methods.
|
||||
*/
|
||||
%rename(f_double) f(double val);
|
||||
|
||||
%include "example.h"
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require("build/Release/example");
|
||||
@@ -0,0 +1,9 @@
|
||||
var example = require("example");
|
||||
|
||||
example.f();
|
||||
example.f(1);
|
||||
example.f(1, 2);
|
||||
example.f("bla");
|
||||
example.f(false);
|
||||
example.f(11111111111);
|
||||
example.f_double(1.0);
|
||||
Reference in New Issue
Block a user