mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 15:58:05 +02:00
python: Make swig bindings python independent.
This commit is contained in:
parent
d18c2ee3d5
commit
bb84ce7159
2 changed files with 8 additions and 10 deletions
|
|
@ -37,7 +37,6 @@
|
|||
%{
|
||||
|
||||
#include <stdio.h>
|
||||
#include <Python.h>
|
||||
|
||||
#include "pipe/p_screen.h"
|
||||
#include "pipe/p_context.h"
|
||||
|
|
@ -58,7 +57,7 @@
|
|||
%}
|
||||
|
||||
%include "typemaps.i"
|
||||
|
||||
%include "exception.i"
|
||||
%include "cstring.i"
|
||||
|
||||
%include "carrays.i"
|
||||
|
|
|
|||
|
|
@ -347,16 +347,15 @@
|
|||
|
||||
assert(p_atomic_read(&$self->reference.count) > 0);
|
||||
|
||||
if(offset > $self->size) {
|
||||
PyErr_SetString(PyExc_ValueError, "offset must be smaller than buffer size");
|
||||
return;
|
||||
}
|
||||
if(offset > $self->size)
|
||||
SWIG_exception(SWIG_ValueError, "offset must be smaller than buffer size");
|
||||
|
||||
if(offset + LENGTH > $self->size) {
|
||||
PyErr_SetString(PyExc_ValueError, "data length must fit inside the buffer");
|
||||
return;
|
||||
}
|
||||
if(offset + LENGTH > $self->size)
|
||||
SWIG_exception(SWIG_ValueError, "data length must fit inside the buffer");
|
||||
|
||||
pipe_buffer_write(screen, $self, offset, LENGTH, STRING);
|
||||
|
||||
fail:
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue