fixes for the examples and tcl to use the old Tcl_SetResult()... methods
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7962 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
99f0122d0d
commit
efcc7aeacf
8 changed files with 47 additions and 17 deletions
|
|
@ -532,7 +532,7 @@ namespace swig
|
|||
typedef Reference reference;
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef int difference_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
|
||||
PySequence_InputIterator()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -30,10 +30,18 @@
|
|||
SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
|
||||
~SWIG_Python_Thread_Allow() { end(); }
|
||||
};
|
||||
# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
|
||||
# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
|
||||
# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
|
||||
# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
|
||||
# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
|
||||
# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
|
||||
# endif
|
||||
# if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
|
||||
# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
|
||||
# endif
|
||||
# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
|
||||
# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
|
||||
# endif
|
||||
# if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
|
||||
# define SWIG_PYTHON_THREAD_END_ALLOW
|
||||
# endif
|
||||
# else /* C code */
|
||||
# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
|
||||
# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
|
||||
|
|
|
|||
|
|
@ -45,7 +45,9 @@
|
|||
#define SWIG_Object Tcl_Obj *
|
||||
|
||||
/* Simple overload of the output/constant/exception handling */
|
||||
#define SWIG_AppendOutput(result,obj) (Tcl_ListObjAppendElement(NULL,result,obj) == TCL_OK) ? result : NULL
|
||||
/* output */
|
||||
#define %set_output(obj) Tcl_SetObjResult(interp,obj)
|
||||
#define %append_output(obj) Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),obj)
|
||||
#define SWIG_SetConstant(name, obj) SWIG_Tcl_SetConstantObj(interp, name, obj)
|
||||
#define SWIG_Raise(obj,type,desc) SWIG_Tcl_SetErrorObj(interp,type,obj)
|
||||
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@
|
|||
|
||||
|
||||
%typemap(out,noblock=1) SWIG_Object {
|
||||
$result = $1;
|
||||
%set_output($1);
|
||||
}
|
||||
|
||||
%typemap(out,noblock=1) SWIG_Object const & {
|
||||
$result = *$1;
|
||||
%set_output(*$1);
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) SWIG_Object "$1 = ($input != 0);";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue