mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +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 <stdio.h>
|
||||||
#include <Python.h>
|
|
||||||
|
|
||||||
#include "pipe/p_screen.h"
|
#include "pipe/p_screen.h"
|
||||||
#include "pipe/p_context.h"
|
#include "pipe/p_context.h"
|
||||||
|
|
@ -58,7 +57,7 @@
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%include "typemaps.i"
|
%include "typemaps.i"
|
||||||
|
%include "exception.i"
|
||||||
%include "cstring.i"
|
%include "cstring.i"
|
||||||
|
|
||||||
%include "carrays.i"
|
%include "carrays.i"
|
||||||
|
|
|
||||||
|
|
@ -347,16 +347,15 @@
|
||||||
|
|
||||||
assert(p_atomic_read(&$self->reference.count) > 0);
|
assert(p_atomic_read(&$self->reference.count) > 0);
|
||||||
|
|
||||||
if(offset > $self->size) {
|
if(offset > $self->size)
|
||||||
PyErr_SetString(PyExc_ValueError, "offset must be smaller than buffer size");
|
SWIG_exception(SWIG_ValueError, "offset must be smaller than buffer size");
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(offset + LENGTH > $self->size) {
|
if(offset + LENGTH > $self->size)
|
||||||
PyErr_SetString(PyExc_ValueError, "data length must fit inside the buffer");
|
SWIG_exception(SWIG_ValueError, "data length must fit inside the buffer");
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
pipe_buffer_write(screen, $self, offset, LENGTH, STRING);
|
pipe_buffer_write(screen, $self, offset, LENGTH, STRING);
|
||||||
|
|
||||||
|
fail:
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue