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.
This commit is contained in:
Vadim Zeitlin 2015-07-18 18:27:43 +02:00
commit 08fa873638
2 changed files with 10 additions and 1 deletions

View file

@ -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 %{

View file

@ -10,6 +10,7 @@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
CPP_TEST_CASES += \
callback \
php_iterator \
php_namewarn_rename \