summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Zeitlin <vz-swig@zeitlins.org>2015-07-18 18:27:43 +0200
committerVadim Zeitlin <vz-swig@zeitlins.org>2015-07-19 00:13:08 +0200
commit08fa873638fc3d1a0169da8583ae492f765d3a5b (patch)
treebc107691c8b19fdc7484d5e86a4d0a1c5ea1831b
parenta00ab42f80e5c6c64b86bf0205f484fa35883b01 (diff)
downloadswig-08fa873638fc3d1a0169da8583ae492f765d3a5b.tar.gz
Make callback unit test pass for PHP backend.
Deprecated %callback(1) doesn't work with PHP, use "%s" to give the same name to the callback as to the C function explicitly instead.
-rw-r--r--Examples/test-suite/callback.i10
-rw-r--r--Examples/test-suite/php/Makefile.in1
2 files changed, 10 insertions, 1 deletions
diff --git a/Examples/test-suite/callback.i b/Examples/test-suite/callback.i
index 8e28dad06..c92994898 100644
--- a/Examples/test-suite/callback.i
+++ b/Examples/test-suite/callback.i
@@ -1,10 +1,18 @@
%module callback
+// Not specifying the callback name is only possible in Python.
+#ifdef SWIGPYTHON
%callback(1) foo;
%callback(1) foof;
%callback(1) A::bar;
%callback(1) A::foom;
-%callback("%s_Cb_Ptr") foo_T; // old style, still works.
+#else
+%callback("%s") foo;
+%callback("%s") foof;
+%callback("%s") A::bar;
+%callback("%s") A::foom;
+#endif
+%callback("%s_Cb_Ptr") foo_T; // this works in Python too
%inline %{
diff --git a/Examples/test-suite/php/Makefile.in b/Examples/test-suite/php/Makefile.in
index c3f8af5cb..c365d01c3 100644
--- a/Examples/test-suite/php/Makefile.in
+++ b/Examples/test-suite/php/Makefile.in
@@ -10,6 +10,7 @@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
CPP_TEST_CASES += \
+ callback \
php_iterator \
php_namewarn_rename \