update swig on windows

This commit is contained in:
Bassem Girgis
2019-08-04 21:38:19 -05:00
parent 8414b7136b
commit 76ad52be58
5943 changed files with 91790 additions and 71892 deletions

View File

@@ -0,0 +1,3 @@
SRCS =
include $(SRCDIR)../example.mk

View File

@@ -0,0 +1,9 @@
{
"targets": [
{
"target_name": "example",
"sources": [ "example_wrap.cxx" ],
"include_dirs": ["$srcdir"]
}
]
}

View File

@@ -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;
}

View File

@@ -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"

View File

@@ -0,0 +1 @@
module.exports = require("build/Release/example");

View File

@@ -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);