diff --git a/.travis.yml b/.travis.yml
index 3368493ad..c669f0b05 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -94,6 +94,11 @@ matrix:
env: SWIGLANG=lua VER=5.3
sudo: required
dist: trusty
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=mzscheme
+ sudo: required
+ dist: trusty
- compiler: gcc
os: linux
env: SWIGLANG=ocaml
@@ -384,6 +389,12 @@ matrix:
env: SWIGLANG=octave SWIGJOBS=-j2 VER=4.4 CPP11=1
sudo: required
dist: trusty
+ # Experimental languages
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=mzscheme
+ sudo: required
+ dist: trusty
before_install:
- date -u
diff --git a/Doc/Manual/Extending.html b/Doc/Manual/Extending.html
index 53c2e68ae..7b2e61e21 100644
--- a/Doc/Manual/Extending.html
+++ b/Doc/Manual/Extending.html
@@ -3626,7 +3626,7 @@ A target language is given the 'Experimental' status when
-
- It is of sub-standard quality, failing to meet the above 'Standard' status.
+ It is of sub-standard quality, failing to meet the above 'Supported' status.
-
It is somewhere between the mid to mature stage of development.
@@ -3652,7 +3652,7 @@ Some minimum requirements and notes about languages with the 'Experimental' stat
Have fully functional examples of basic functionality (the simple and class examples).
-
- The test-suite must be implemented and include some runtime tests for wrapped C and C++ tests.
+ The test-suite must be implemented and include a few runtime tests for both C and C++ test cases.
-
Failing tests must be put into one of the FAILING_CPP_TESTS or FAILING_C_TESTS lists in the test-suite.
@@ -3668,7 +3668,7 @@ Some minimum requirements and notes about languages with the 'Experimental' stat
Any new failed tests will be fixed on a 'best effort' basis by core developers with no promises made.
-
- If a language module has an official maintainer, then the maintainer will be requested to focus on fixing test-suite regressions and commit to migrating the module to become a 'Standard' module.
+ If a language module has an official maintainer, then the maintainer will be requested to focus on fixing test-suite regressions and commit to migrating the module to become a 'Supported' module.
-
If a module does not have an official maintainer, then, as maintenance will be on a 'best efforts' basis by the core maintainers, no guarantees will be provided from one release to the next and regressions may creep in.
diff --git a/Doc/Manual/SWIG.html b/Doc/Manual/SWIG.html
index 365cd2940..be6eda739 100644
--- a/Doc/Manual/SWIG.html
+++ b/Doc/Manual/SWIG.html
@@ -125,7 +125,6 @@ Supported Target Language Options
-java - Generate Java wrappers
-javascript - Generate Javascript wrappers
-lua - Generate Lua wrappers
- -mzscheme - Generate Mzscheme wrappers
-ocaml - Generate Ocaml wrappers
-octave - Generate Octave wrappers
-perl5 - Generate Perl 5 wrappers
@@ -138,6 +137,7 @@ Supported Target Language Options
-xml - Generate XML wrappers
Experimental Target Language Options
+ -mzscheme - Generate MzScheme/Racket wrappers
General Options
-addextern - Add extra extern declarations
diff --git a/Examples/Makefile.in b/Examples/Makefile.in
index 450824400..c5dcb1ee1 100644
--- a/Examples/Makefile.in
+++ b/Examples/Makefile.in
@@ -813,7 +813,7 @@ MZSCHEME = mzscheme
MZC = @MZC@
MZDYNOBJ = @MZDYNOBJ@
MZSCHEME_SO = @MZSCHEME_SO@
-MZSCHEME_SCRIPT = $(RUNME).scm
+MZSCHEME_SCRIPT = $(SRCDIR)$(RUNME).scm
# ----------------------------------------------------------------
# Build a C/C++ dynamically loadable module
@@ -821,12 +821,12 @@ MZSCHEME_SCRIPT = $(RUNME).scm
mzscheme: $(SRCDIR_SRCS)
$(SWIG) -mzscheme $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
- $(COMPILETOOL) $(MZC) `echo $(INCLUDES) | sed 's/-I/++ccf -I/g'` --cc $(ISRCS) $(SRCDIR_SRCS)
+ $(COMPILETOOL) $(MZC) `echo $(CPPFLAGS) $(INCLUDES) | sed 's/-I/++ccf -I/g'` --cc $(ISRCS) $(SRCDIR_SRCS)
$(COMPILETOOL) $(MZC) --ld $(TARGET)$(MZSCHEME_SO) $(OBJS) $(IOBJS)
mzscheme_cpp: $(SRCDIR_SRCS)
$(SWIG) -mzscheme -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
- $(COMPILETOOL) $(MZC) `echo $(INCLUDES) | sed 's/-I/++ccf -I/g'` --cc $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS)
+ $(COMPILETOOL) $(MZC) `echo $(CPPFLAGS) $(INCLUDES) | sed 's/-I/++ccf -I/g'` --cc $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS)
$(CXXSHARED) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $(LIBPREFIX)$(TARGET)$(MZSCHEME_SO) $(OBJS) $(IOBJS) $(MZDYNOBJ) $(CPP_DLLIBS)
# -----------------------------------------------------------------
diff --git a/Examples/guile/simple/example.c b/Examples/guile/simple/example.c
index dcafc4dc4..1c2af789c 100644
--- a/Examples/guile/simple/example.c
+++ b/Examples/guile/simple/example.c
@@ -1,21 +1,18 @@
-/* Simple example from documentation */
/* File : example.c */
-#include
+/* A global variable */
+double Foo = 3.0;
-double My_variable = 3.0;
-
-int fact(int n) {
- if (n <= 1) return 1;
- else return n*fact(n-1);
+/* 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;
}
-int mod(int n, int m) {
- return (n % m);
-}
-char *get_time() {
- long ltime;
- time(<ime);
- return ctime(<ime);
-}
diff --git a/Examples/guile/simple/example.i b/Examples/guile/simple/example.i
index 1a9930a14..4fcea98b2 100644
--- a/Examples/guile/simple/example.i
+++ b/Examples/guile/simple/example.i
@@ -5,10 +5,8 @@
%}
%inline %{
-extern double My_variable;
-extern int fact(int);
-extern int mod(int n, int m);
-extern char *get_time();
+extern int gcd(int x, int y);
+extern double Foo;
%}
%include guile/guilemain.i
diff --git a/Examples/guile/simple/runme.scm b/Examples/guile/simple/runme.scm
index c3fd0b41f..ccd755701 100644
--- a/Examples/guile/simple/runme.scm
+++ b/Examples/guile/simple/runme.scm
@@ -3,24 +3,20 @@
(for-each display args)
(newline))
-(mdisplay-newline (get-time) "My variable = " (My-variable))
+; Call our gcd() function
-(do ((i 0 (1+ i)))
- ((= 14 i))
- (mdisplay-newline i " factorial is " (fact i)))
+(define x 42)
+(define y 105)
+(define g (gcd x y))
+(mdisplay-newline "The gcd of " x " and " y " is " g)
-(define (mods i imax j jmax)
- (if (< i imax)
- (if (< j jmax)
- (begin
- (My-variable (+ (My-variable) (mod i j)))
- (mods i imax (+ j 1) jmax))
- (mods (+ i 1) imax 1 jmax))))
+; Manipulate the Foo global variable
-(mods 1 150 1 150)
+; Output its current value
+(mdisplay-newline "Foo = " (Foo))
-(mdisplay-newline "My-variable = " (My-variable))
-
-(exit (and (= 1932053504 (fact 13))
- (= 745470.0 (My-variable))))
+; Change its value
+(Foo 3.1415926)
+; See if the change took effect
+(mdisplay-newline "Foo = " (Foo))
diff --git a/Examples/mzscheme/check.list b/Examples/mzscheme/check.list
index f9e4f11c7..d2554c41c 100644
--- a/Examples/mzscheme/check.list
+++ b/Examples/mzscheme/check.list
@@ -1,4 +1,5 @@
# see top-level Makefile.in
+class
multimap
simple
std_vector
diff --git a/Examples/mzscheme/class/Makefile b/Examples/mzscheme/class/Makefile
new file mode 100644
index 000000000..0b36a60d7
--- /dev/null
+++ b/Examples/mzscheme/class/Makefile
@@ -0,0 +1,18 @@
+TOP = ../..
+SWIGEXE = $(TOP)/../swig
+SWIG_LIB_DIR = $(TOP)/../$(TOP_BUILDDIR_TO_TOP_SRCDIR)Lib
+CXXSRCS = example.cxx
+TARGET = example
+INTERFACE = example.i
+SWIGOPT =
+
+check: build
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_run
+
+build:
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
+ SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' mzscheme_cpp
+
+clean:
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_clean
diff --git a/Examples/mzscheme/class/example.cxx b/Examples/mzscheme/class/example.cxx
new file mode 100644
index 000000000..046304519
--- /dev/null
+++ b/Examples/mzscheme/class/example.cxx
@@ -0,0 +1,28 @@
+/* File : example.cxx */
+
+#include "example.h"
+#define M_PI 3.14159265358979323846
+
+/* Move the shape to a new location */
+void Shape::move(double dx, double dy) {
+ x += dx;
+ y += dy;
+}
+
+int Shape::nshapes = 0;
+
+double Circle::area() {
+ return M_PI*radius*radius;
+}
+
+double Circle::perimeter() {
+ return 2*M_PI*radius;
+}
+
+double Square::area() {
+ return width*width;
+}
+
+double Square::perimeter() {
+ return 4*width;
+}
diff --git a/Examples/mzscheme/class/example.h b/Examples/mzscheme/class/example.h
new file mode 100644
index 000000000..0dff185b2
--- /dev/null
+++ b/Examples/mzscheme/class/example.h
@@ -0,0 +1,34 @@
+/* File : example.h */
+
+class Shape {
+public:
+ Shape() {
+ nshapes++;
+ }
+ virtual ~Shape() {
+ nshapes--;
+ }
+ double x, y;
+ void move(double dx, double dy);
+ virtual double area() = 0;
+ virtual double perimeter() = 0;
+ static int nshapes;
+};
+
+class Circle : public Shape {
+private:
+ double radius;
+public:
+ Circle(double r) : radius(r) { }
+ virtual double area();
+ virtual double perimeter();
+};
+
+class Square : public Shape {
+private:
+ double width;
+public:
+ Square(double w) : width(w) { }
+ virtual double area();
+ virtual double perimeter();
+};
diff --git a/Examples/mzscheme/class/example.i b/Examples/mzscheme/class/example.i
new file mode 100644
index 000000000..fbdf7249f
--- /dev/null
+++ b/Examples/mzscheme/class/example.i
@@ -0,0 +1,9 @@
+/* File : example.i */
+%module example
+
+%{
+#include "example.h"
+%}
+
+/* Let's just grab the original header file here */
+%include "example.h"
diff --git a/Examples/mzscheme/class/runme.scm b/Examples/mzscheme/class/runme.scm
new file mode 100644
index 000000000..dea0b75bc
--- /dev/null
+++ b/Examples/mzscheme/class/runme.scm
@@ -0,0 +1,60 @@
+; file: runme.scm
+
+; This file illustrates the proxy class C++ interface generated
+; by SWIG.
+
+(load-extension "example.so")
+
+; Convenience wrapper around the display function
+; (which only accepts one argument at the time)
+
+(define (mdisplay-newline . args)
+ (for-each display args)
+ (newline))
+
+; ----- Object creation -----
+
+(mdisplay-newline "Creating some objects:")
+(define c (new-Circle 10))
+(mdisplay-newline " Created circle " c)
+(define s (new-Square 10))
+(mdisplay-newline " Created square " s)
+
+; ----- Access a static member -----
+
+(mdisplay-newline "\nA total of " (Shape-nshapes) " shapes were created")
+
+; ----- Member data access -----
+
+; Set the location of the object
+
+(Shape-x-set c 20)
+(Shape-y-set c 30)
+
+(Shape-x-set s -10)
+(Shape-y-set s 5)
+
+(mdisplay-newline "\nHere is their current position:")
+(mdisplay-newline " Circle = (" (Shape-x-get c) "," (Shape-y-get c) ")")
+(mdisplay-newline " Square = (" (Shape-x-get s) "," (Shape-y-get s) ")")
+
+; ----- Call some methods -----
+
+(mdisplay-newline "\nHere are some properties of the shapes:")
+(define (shape-props o)
+ (mdisplay-newline " " o)
+ (mdisplay-newline " area = " (Shape-area o))
+ (mdisplay-newline " perimeter = " (Shape-perimeter o)))
+(for-each shape-props (list c s))
+
+(mdisplay-newline "\nGuess I'll clean up now")
+
+; Note: this invokes the virtual destructor
+(delete-Shape c)
+(delete-Shape s)
+
+(define s 3)
+(mdisplay-newline (Shape-nshapes) " shapes remain")
+(mdisplay-newline "Goodbye")
+
+(exit 0)
diff --git a/Examples/mzscheme/multimap/Makefile b/Examples/mzscheme/multimap/Makefile
index 713ee43a7..eccd59d82 100644
--- a/Examples/mzscheme/multimap/Makefile
+++ b/Examples/mzscheme/multimap/Makefile
@@ -13,5 +13,6 @@ build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' mzscheme
+
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_clean
diff --git a/Examples/mzscheme/multimap/example.c b/Examples/mzscheme/multimap/example.c
index b8360fa8a..e945042ab 100644
--- a/Examples/mzscheme/multimap/example.c
+++ b/Examples/mzscheme/multimap/example.c
@@ -27,7 +27,7 @@ int gcdmain(int argc, char *argv[]) {
return 0;
}
-int count(char *bytes, int len, char c) {
+int charcount(char *bytes, int len, char c) {
int i;
int count = 0;
for (i = 0; i < len; i++) {
diff --git a/Examples/mzscheme/multimap/example.i b/Examples/mzscheme/multimap/example.i
index 515948abc..db4be3d16 100644
--- a/Examples/mzscheme/multimap/example.i
+++ b/Examples/mzscheme/multimap/example.i
@@ -4,7 +4,7 @@
%{
extern int gcd(int x, int y);
extern int gcdmain(int argc, char *argv[]);
-extern int count(char *bytes, int len, char c);
+extern int charcount(char *bytes, int len, char c);
extern void capitalize (char *str, int len);
extern void circle (double cx, double cy);
extern int squareCubed (int n, int *OUTPUT);
@@ -50,7 +50,7 @@ extern int gcdmain(int argc, char *argv[]);
$2 = SCHEME_STRLEN_VAL($input);
}
-extern int count(char *bytes, int len, char c);
+extern int charcount(char *bytes, int len, char c);
/* This example shows how to wrap a function that mutates a string */
@@ -68,7 +68,7 @@ extern int count(char *bytes, int len, char c);
%typemap(argout) (char *str, int len) {
Scheme_Object *s;
- s = scheme_make_sized_string($1,$2,1);
+ s = scheme_make_sized_string($1,$2);
SWIG_APPEND_VALUE(s);
free($1);
}
diff --git a/Examples/mzscheme/multimap/runme.scm b/Examples/mzscheme/multimap/runme.scm
index f1e626f43..6d2c9cce3 100644
--- a/Examples/mzscheme/multimap/runme.scm
+++ b/Examples/mzscheme/multimap/runme.scm
@@ -20,7 +20,7 @@
(gcdmain #("gcdmain" "42" "105"))
-(display (count "Hello World" #\l))
+(display (charcount "Hello World" #\l))
(newline)
(display (capitalize "hello world"))
diff --git a/Examples/mzscheme/simple/Makefile b/Examples/mzscheme/simple/Makefile
index 713ee43a7..eccd59d82 100644
--- a/Examples/mzscheme/simple/Makefile
+++ b/Examples/mzscheme/simple/Makefile
@@ -13,5 +13,6 @@ build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' mzscheme
+
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_clean
diff --git a/Examples/mzscheme/simple/README b/Examples/mzscheme/simple/README
deleted file mode 100644
index 07e8da069..000000000
--- a/Examples/mzscheme/simple/README
+++ /dev/null
@@ -1 +0,0 @@
-Simple example from users manual.
diff --git a/Examples/mzscheme/simple/example.c b/Examples/mzscheme/simple/example.c
index f2b074781..1c2af789c 100644
--- a/Examples/mzscheme/simple/example.c
+++ b/Examples/mzscheme/simple/example.c
@@ -1,24 +1,18 @@
-/* Simple example from documentation */
/* File : example.c */
-#include
+/* A global variable */
+double Foo = 3.0;
-double My_variable = 3.0;
-
-/* Compute factorial of n */
-int fact(int n) {
- if (n <= 1) return 1;
- else return n*fact(n-1);
-}
-
-/* Compute n mod m */
-int my_mod(int n, int m) {
- return (n % m);
+/* 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;
}
-char *get_time() {
- long ltime;
- time(<ime);
- return ctime(<ime);
-}
diff --git a/Examples/mzscheme/simple/example.i b/Examples/mzscheme/simple/example.i
index 5b3e95580..24093b9bf 100644
--- a/Examples/mzscheme/simple/example.i
+++ b/Examples/mzscheme/simple/example.i
@@ -1,16 +1,7 @@
/* File : example.i */
%module example
-%{
-/* Put headers and other declarations here */
-%}
-
-%include typemaps.i
-
-%rename(mod) my_mod;
%inline %{
-extern double My_variable;
-extern int fact(int);
-extern int my_mod(int n, int m);
-extern char *get_time();
+extern int gcd(int x, int y);
+extern double Foo;
%}
diff --git a/Examples/mzscheme/simple/runme.scm b/Examples/mzscheme/simple/runme.scm
index a98e31fd5..88d32d6fc 100644
--- a/Examples/mzscheme/simple/runme.scm
+++ b/Examples/mzscheme/simple/runme.scm
@@ -2,23 +2,30 @@
(load-extension "example.so")
-(display (get-time))
+; Call our gcd() function
-(printf "My-variable = ~a~n" (my-variable))
+(define x 42)
+(define y 105)
+(define g (gcd x y))
+(display "The gcd of ")
+(display x)
+(display " and ")
+(display y)
+(display " is ")
+(display g)
+(newline)
-(let loop ((i 0))
- (when (< i 14) (begin (display i)
- (display " factorial is ")
- (display (fact i))
- (newline)
- (loop (+ i 1)))))
+; Manipulate the Foo global variable
-(let loop ((i 1))
- (when (< i 250)
- (begin
- (let loopi ((j 1))
- (when (< j 250) (begin (my-variable (+ (my-variable) (mod i j)))
- (loopi (+ j 1)))))
- (loop (+ i 1)))))
+; Output its current value
+(display "Foo = ")
+(display (Foo))
+(newline)
-(printf "My-variable = ~a~n" (my-variable))
+; Change its value
+(Foo 3.1415926)
+
+; See if the change took effect
+(display "Foo = ")
+(display (Foo))
+(newline)
diff --git a/Examples/mzscheme/std_vector/Makefile b/Examples/mzscheme/std_vector/Makefile
index 96f5e80cf..8057465b3 100644
--- a/Examples/mzscheme/std_vector/Makefile
+++ b/Examples/mzscheme/std_vector/Makefile
@@ -1,21 +1,18 @@
TOP = ../..
SWIGEXE = $(TOP)/../swig
SWIG_LIB_DIR = $(TOP)/../$(TOP_BUILDDIR_TO_TOP_SRCDIR)Lib
-SRCS =
+CXXSRCS =
TARGET = example
INTERFACE = example.i
SWIGOPT =
-GPP = `which g++`
-MZC = test -n "/usr/bin/mzc" && /usr/bin/mzc
-
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_run
build:
- $(SWIGEXE) -mzscheme -c++ $(SWIGOPT) $(INTERFACE)
- $(MZC) --compiler $(GPP) ++ccf "-I." --cc example_wrap.cxx
- $(MZC) --linker $(GPP) --ld $(TARGET).so example_wrap.o
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
+ SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' mzscheme_cpp
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_clean
diff --git a/Examples/mzscheme/std_vector/runme.scm b/Examples/mzscheme/std_vector/runme.scm
index 67351f128..7af9d168e 100644
--- a/Examples/mzscheme/std_vector/runme.scm
+++ b/Examples/mzscheme/std_vector/runme.scm
@@ -9,16 +9,17 @@
(if (< i size)
(begin
(proc v i)
- (with-vector-item v (+ i 1)))))
+ (with-vector-item v (+ i 1)))
+ (void)))
(with-vector-item v 0)))
-(define (with-intvector v proc)
- (with-vector v proc intvector-length))
-(define (with-doublevector v proc)
- (with-vector v proc doublevector-length))
+(define (with-IntVector v proc)
+ (with-vector v proc IntVector-length))
+(define (with-DoubleVector v proc)
+ (with-vector v proc DoubleVector-length))
-(define (print-doublevector v)
- (with-doublevector v (lambda (v i) (display (doublevector-ref v i))
+(define (print-DoubleVector v)
+ (with-DoubleVector v (lambda (v i) (display (DoubleVector-ref v i))
(display " ")))
(newline))
@@ -29,11 +30,11 @@
(newline)
; ... or a wrapped std::vector
-(define v (new-intvector 4))
-(with-intvector v (lambda (v i) (intvector-set! v i (+ i 1))))
+(define v (new-IntVector 4))
+(with-IntVector v (lambda (v i) (IntVector-set! v i (+ i 1))))
(display (average v))
(newline)
-(delete-intvector v)
+(delete-IntVector v)
; half will return a Scheme vector.
; Call it with a Scheme vector...
@@ -42,13 +43,12 @@
(newline)
; ... or a wrapped std::vector
-(define v (new-doublevector))
-(map (lambda (i) (doublevector-push! v i)) '(1 2 3 4))
+(define v (new-DoubleVector))
+(map (lambda (i) (DoubleVector-push! v i)) '(1 2 3 4))
(display (half v))
(newline)
; now halve a wrapped std::vector in place
(halve-in-place v)
-(print-doublevector v)
-(delete-doublevector v)
-
+(print-DoubleVector v)
+(delete-DoubleVector v)
diff --git a/Examples/test-suite/mzscheme/Makefile.in b/Examples/test-suite/mzscheme/Makefile.in
index 3e15f8610..4338b9b1f 100644
--- a/Examples/test-suite/mzscheme/Makefile.in
+++ b/Examples/test-suite/mzscheme/Makefile.in
@@ -10,10 +10,67 @@ srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
+FAILING_CPP_TESTS = \
+allowexcept \
+apply_strings \
+arrays_dimensionless \
+arrays_global \
+char_strings \
+class_scope_weird \
+constant_pointers \
+cpp_basic \
+cpp_enum \
+curiously_recurring_template_pattern \
+default_arg_expressions \
+default_constructor \
+derived_nested \
+director_ignore \
+enum_thorough \
+extend \
+friends \
+global_scope_types \
+inherit_member \
+li_attribute \
+li_attribute_template \
+li_boost_shared_ptr \
+li_std_combinations \
+li_std_map \
+li_std_pair \
+li_std_pair_using \
+li_std_string \
+li_std_vector \
+li_windows \
+member_funcptr_galore \
+member_pointer \
+member_pointer_const \
+memberin_extend \
+namespace_spaces \
+naturalvar \
+naturalvar_more \
+nested_class \
+nested_template_base \
+ordering \
+preproc_constants \
+samename \
+template_default2 \
+template_specialization_defarg \
+template_typemaps \
+typemap_variables \
+valuewrapper_opaque \
+
+FAILING_C_TESTS = \
+enums \
+integers \
+preproc_constants_c \
+preproc_line_file \
+
+FAILING_MULTI_CPP_TESTS = \
+multi_import \
+
include $(srcdir)/../common.mk
# Overridden variables here
-# none!
+SWIGOPT += -w524 # Suppress SWIGWARN_LANG_EXPERIMENTAL warning
# Custom tests - tests with additional commandline options
# none!
diff --git a/Examples/test-suite/mzscheme/name_runme.scm b/Examples/test-suite/mzscheme/name_runme.scm
index 1782c6481..94df9131d 100644
--- a/Examples/test-suite/mzscheme/name_runme.scm
+++ b/Examples/test-suite/mzscheme/name_runme.scm
@@ -1,7 +1,7 @@
;; The SWIG modules have "passive" Linkage, i.e., they don't generate
;; Guile modules (namespaces) but simply put all the bindings into the
;; current module. That's enough for such a simple test.
-(load-extension "./name.so")
+(load-extension "name.so")
(foo-2)
bar-2
diff --git a/Examples/test-suite/mzscheme/unions_runme.scm b/Examples/test-suite/mzscheme/unions_runme.scm
index c44847cfc..1c39cb94c 100644
--- a/Examples/test-suite/mzscheme/unions_runme.scm
+++ b/Examples/test-suite/mzscheme/unions_runme.scm
@@ -25,13 +25,15 @@
(if (not (= Jill1 200))
(begin
(display "Runtime test 1 failed.")
- (exit 1))))
+ (exit 1))
+ (void)))
(let ((Num1 (EmbeddedUnionTest-number-get eut)))
(if (not (= Num1 1))
(begin
(display "Runtime test 2 failed.")
- (exit 1))))
+ (exit 1))
+ (void)))
;; that should do
diff --git a/Source/Modules/mzscheme.cxx b/Source/Modules/mzscheme.cxx
index e826e6b3c..23be87d0f 100644
--- a/Source/Modules/mzscheme.cxx
+++ b/Source/Modules/mzscheme.cxx
@@ -17,12 +17,10 @@
static const char *usage = "\
Mzscheme Options (available with -mzscheme)\n\
- -declaremodule - Create extension that declares a module\n\
- -dynamic-load ,[library,...] - Do not link with these libraries, dynamic load\n\
- them\n\
- -noinit - Do not emit scheme_initialize, scheme_reload,\n\
- scheme_module_name functions\n\
- -prefix - Set a prefix to be prepended to all names\n\
+ -declaremodule - Create extension that declares a module\n\
+ -dynamic-load ,[lib,...] - Do not link with these libraries, dynamic load them\n\
+ -noinit - Do not emit module initialization code\n\
+ -prefix - Set a prefix to be prepended to all names\n\
";
static String *fieldnames_tab = 0;
@@ -439,9 +437,8 @@ public:
sprintf(temp, "%d", numargs);
if (exporting_destructor) {
Printf(init_func_def, "SWIG_TypeClientData(SWIGTYPE%s, (void *) %s);\n", swigtype_ptr, wname);
- } else {
- Printf(init_func_def, "scheme_add_global(\"%s\", scheme_make_prim_w_arity(%s,\"%s\",%d,%d),menv);\n", proc_name, wname, proc_name, numreq, numargs);
}
+ Printf(init_func_def, "scheme_add_global(\"%s\", scheme_make_prim_w_arity(%s,\"%s\",%d,%d),menv);\n", proc_name, wname, proc_name, numreq, numargs);
} else {
if (!Getattr(n, "sym:nextSibling")) {
/* Emit overloading dispatch function */
@@ -528,7 +525,7 @@ public:
Replaceall(tm, "$source", "argv[0]");
Replaceall(tm, "$target", name);
Replaceall(tm, "$input", "argv[0]");
- /* Printv(f->code, tm, "\n",NIL); */
+ Replaceall(tm, "$argnum", "1");
emit_action_code(n, f->code, tm);
} else {
throw_unhandled_mzscheme_type_error(t);
diff --git a/Source/Modules/swigmain.cxx b/Source/Modules/swigmain.cxx
index 472264c26..a9916ad9a 100644
--- a/Source/Modules/swigmain.cxx
+++ b/Source/Modules/swigmain.cxx
@@ -63,7 +63,7 @@ static TargetLanguageModule modules[] = {
{"-javascript", swig_javascript, "Javascript", Supported},
{"-lua", swig_lua, "Lua", Supported},
{"-modula3", NULL, "Modula 3", Disabled},
- {"-mzscheme", swig_mzscheme, "Mzscheme", Supported},
+ {"-mzscheme", swig_mzscheme, "MzScheme/Racket", Experimental},
{"-ocaml", swig_ocaml, "Ocaml", Supported},
{"-octave", swig_octave, "Octave", Supported},
{"-perl", swig_perl5, NULL, Supported},
diff --git a/Tools/travis-linux-install.sh b/Tools/travis-linux-install.sh
index caf53dbc1..dc8526546 100755
--- a/Tools/travis-linux-install.sh
+++ b/Tools/travis-linux-install.sh
@@ -72,6 +72,9 @@ case "$SWIGLANG" in
travis_retry sudo apt-get -qq install lua${VER} liblua${VER}-dev
fi
;;
+ "mzscheme")
+ travis_retry sudo apt-get -qq install racket
+ ;;
"ocaml")
# configure also looks for ocamldlgen, but this isn't packaged. But it isn't used by default so this doesn't matter.
travis_retry sudo apt-get -qq install ocaml ocaml-findlib