diff --git a/src/python/corrade/PyBuffer.h b/src/python/corrade/PyBuffer.h index 0a7dbe8..b04a162 100644 --- a/src/python/corrade/PyBuffer.h +++ b/src/python/corrade/PyBuffer.h @@ -50,8 +50,9 @@ template void enableBetterB CORRADE_INTERNAL_ASSERT(!PyErr_Occurred() && buffer); /* Zero-initialize the output and ask the class to fill it. If that - fails for some reason, give up */ - *buffer = Py_buffer{}; + fails for some reason, give up. Need to list all members otherwise + GCC 4.8 loudly complains about missing initializers. */ + *buffer = Py_buffer{nullptr, nullptr, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr, nullptr}; if(!getter(pyInstanceFromHandle(obj), *buffer, flags)) { CORRADE_INTERNAL_ASSERT(!buffer->obj); CORRADE_INTERNAL_ASSERT(PyErr_Occurred()); diff --git a/src/python/corrade/containers.cpp b/src/python/corrade/containers.cpp index 572c67a..26cf39e 100644 --- a/src/python/corrade/containers.cpp +++ b/src/python/corrade/containers.cpp @@ -109,7 +109,8 @@ template void arrayView(py::class_, Containers /* Buffer protocol */ .def(py::init([](py::buffer other) { - Py_buffer buffer{}; + /* GCC 4.8 otherwise loudly complains about missing initializers */ + Py_buffer buffer{nullptr, nullptr, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr, nullptr}; if(PyObject_GetBuffer(other.ptr(), &buffer, (std::is_const::value ? 0 : PyBUF_WRITABLE)) != 0) throw py::error_already_set{}; @@ -312,7 +313,8 @@ template void stridedArrayView(py::class_::value ? 0 : PyBUF_WRITABLE)) != 0) throw py::error_already_set{}; diff --git a/src/python/magnum/math.matrix.h b/src/python/magnum/math.matrix.h index 49fae55..a6a4d37 100644 --- a/src/python/magnum/math.matrix.h +++ b/src/python/magnum/math.matrix.h @@ -107,7 +107,8 @@ template void everyRectangularMatrixBuffer(py::class_ void everyVectorBuffer(py::class_& arrays of non-default types somehow doesn't work. There's also the other part in vectorBuffer(). */ .def(py::init([](py::buffer other) { - Py_buffer buffer{}; + /* GCC 4.8 otherwise loudly complains about missing initializers */ + Py_buffer buffer{nullptr, nullptr, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr, nullptr}; if(PyObject_GetBuffer(other.ptr(), &buffer, PyBUF_FORMAT|PyBUF_STRIDES) != 0) throw py::error_already_set{};