update swig on windows
This commit is contained in:
1
winx64/bin/swigwin-4.0.0/Examples/d/simple/Makefile
Normal file
1
winx64/bin/swigwin-4.0.0/Examples/d/simple/Makefile
Normal file
@@ -0,0 +1 @@
|
||||
include ../example.mk
|
||||
27
winx64/bin/swigwin-4.0.0/Examples/d/simple/d1/runme.d
Normal file
27
winx64/bin/swigwin-4.0.0/Examples/d/simple/d1/runme.d
Normal file
@@ -0,0 +1,27 @@
|
||||
module runme;
|
||||
|
||||
import tango.io.Stdout;
|
||||
static import example;
|
||||
|
||||
void main() {
|
||||
/*
|
||||
* Call our gcd() function.
|
||||
*/
|
||||
int x = 42;
|
||||
int y = 105;
|
||||
int g = example.gcd( x, y );
|
||||
Stdout.format( "The gcd of {} and {} is {}.", x, y, g ).newline;
|
||||
|
||||
/*
|
||||
* Manipulate the Foo global variable.
|
||||
*/
|
||||
|
||||
// Output its current value
|
||||
Stdout.format( "Foo = {}", example.Foo ).newline;
|
||||
|
||||
// Change its value
|
||||
example.Foo = 3.1415926;
|
||||
|
||||
// See if the change took effect
|
||||
Stdout.format( "Foo = {}", example.Foo ).newline;
|
||||
}
|
||||
27
winx64/bin/swigwin-4.0.0/Examples/d/simple/d2/runme.d
Normal file
27
winx64/bin/swigwin-4.0.0/Examples/d/simple/d2/runme.d
Normal file
@@ -0,0 +1,27 @@
|
||||
module runme;
|
||||
|
||||
import std.stdio;
|
||||
static import example;
|
||||
|
||||
void main() {
|
||||
/*
|
||||
* Call our gcd() function.
|
||||
*/
|
||||
int x = 42;
|
||||
int y = 105;
|
||||
int g = example.gcd(x, y);
|
||||
writefln("The gcd of %s and %s is %s.", x, y, g);
|
||||
|
||||
/*
|
||||
* Manipulate the Foo global variable.
|
||||
*/
|
||||
|
||||
// Output its current value
|
||||
writefln("Foo = %s", example.Foo);
|
||||
|
||||
// Change its value
|
||||
example.Foo = 3.1415926;
|
||||
|
||||
// See if the change took effect
|
||||
writefln("Foo = %s", example.Foo);
|
||||
}
|
||||
18
winx64/bin/swigwin-4.0.0/Examples/d/simple/example.c
Normal file
18
winx64/bin/swigwin-4.0.0/Examples/d/simple/example.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/* File : example.c */
|
||||
|
||||
/* A global variable */
|
||||
double Foo = 3.0;
|
||||
|
||||
/* Compute the greatest common divisor of positive integers */
|
||||
int gcd(int x, int y) {
|
||||
int g;
|
||||
g = y;
|
||||
while (x > 0) {
|
||||
g = x;
|
||||
x = y % x;
|
||||
y = g;
|
||||
}
|
||||
return g;
|
||||
}
|
||||
|
||||
|
||||
7
winx64/bin/swigwin-4.0.0/Examples/d/simple/example.i
Normal file
7
winx64/bin/swigwin-4.0.0/Examples/d/simple/example.i
Normal file
@@ -0,0 +1,7 @@
|
||||
/* File : example.i */
|
||||
%module example
|
||||
|
||||
%inline %{
|
||||
extern int gcd(int x, int y);
|
||||
extern double Foo;
|
||||
%}
|
||||
Reference in New Issue
Block a user