Correct build errors

This commit is contained in:
2018-09-06 10:47:10 +10:00
parent 6d04e48539
commit 539c140b3e
2 changed files with 1 additions and 44 deletions

View File

@@ -41,6 +41,7 @@
#include "BKE_scene.h"
#include "DNA_screen_types.h"
#include "DNA_scene_types.h"
#include "DNA_view3d_types.h"
#include "GPU_framebuffer.h"

View File

@@ -39,50 +39,6 @@
#include "gpu_py_vertex_format.h"
#include "gpu_py_vertex_buffer.h" /* own include */
/* -------------------------------------------------------------------- */
/** \name Enum Conversion
*
* Use with PyArg_ParseTuple's "O&" formatting.
* \{ */
static int bpygpu_ParseVertFetchMode(PyObject *o, void *p)
{
Py_ssize_t mode_id_len;
const char *mode_id = _PyUnicode_AsStringAndSize(o, &mode_id_len);
if (mode_id == NULL) {
PyErr_Format(PyExc_ValueError,
"expected a string, got %s",
Py_TYPE(o)->tp_name);
return 0;
}
#define MATCH_ID(id) \
if (mode_id_len == strlen(STRINGIFY(id))) { \
if (STREQ(mode_id, STRINGIFY(id))) { \
mode = GPU_FETCH_##id; \
goto success; \
} \
} ((void)0)
GPUVertFetchMode mode;
MATCH_ID(FLOAT);
MATCH_ID(INT);
MATCH_ID(INT_TO_FLOAT_UNIT);
MATCH_ID(INT_TO_FLOAT);
#undef MATCH_ID
PyErr_Format(PyExc_ValueError,
"unknown type literal: '%s'",
mode_id);
return 0;
success:
(*(GPUVertFetchMode *)p) = mode;
return 1;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Utility Functions