Some changes to generated proxy .c and .h file.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@10522 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Maciej Drwal 2008-06-07 20:30:42 +00:00
commit d828791f56
4 changed files with 92 additions and 24 deletions

View file

@ -1,7 +1,7 @@
/* File : example.c */
/* A global variable */
/* double Foo = 3.0; */
double Foo = 3.0;
/* Compute the greatest common divisor of positive integers */
int gcd(int x, int y) {

View file

@ -1,9 +1,8 @@
/* File : example.i */
%module example
%feature("prepend") {
printf("Testing...\n");
}
%inline %{
extern double Foo;
extern int gcd(int x, int y);
%}

View file

@ -1,8 +1,12 @@
#include <stdio.h>
#include "example_proxy.h"
int main(int argc, char **argv) {
int a = 35;
int b = 15;
printf("GCD(%d, %d)=%d", a, b, gcd(a, b));
printf("Foo is %f\n", Foo);
printf("GCD(%d, %d)=%d\n", a, b, gcd(a, b));
return 0;
}