Use PyObject_AsReadBuffer in the typemap for getting buffer or buffer
compatible objects git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -319,16 +319,19 @@ MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field)
|
|||||||
// Typemaps for loading a image or bitmap from an object that implements the
|
// Typemaps for loading a image or bitmap from an object that implements the
|
||||||
// buffer interface
|
// buffer interface
|
||||||
|
|
||||||
|
|
||||||
%typemap(in) (buffer data, int DATASIZE)
|
%typemap(in) (buffer data, int DATASIZE)
|
||||||
{ if ($input != Py_None) {
|
{
|
||||||
if (!PyArg_Parse($input, "t#", &$1, &$2)) SWIG_fail;
|
if (PyObject_AsReadBuffer($input, (const void**)(&$1), &$2) == -1) SWIG_fail;
|
||||||
}}
|
}
|
||||||
|
|
||||||
%typemap(in) (buffer alpha, int ALPHASIZE)
|
%typemap(in) (buffer alpha, int ALPHASIZE)
|
||||||
{ if ($input != Py_None) {
|
{
|
||||||
if (!PyArg_Parse($input, "t#", &$1, &$2)) SWIG_fail;
|
if ($input != Py_None) {
|
||||||
}}
|
if (PyObject_AsReadBuffer($input, (const void**)(&$1), &$2) == -1) SWIG_fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Typemaps to convert return values that are base class pointers
|
// Typemaps to convert return values that are base class pointers
|
||||||
|
Reference in New Issue
Block a user