Browse Source

python: suppress Clang's -Wgnu-zero-variadic-macro-arguments warning.

Hmm. I seem to be the only one on Earth using pybind11 with Clang. Or
does everyone else just ignore all those warnings?!
pull/2/head
Vladimír Vondruš 7 years ago
parent
commit
375a22f08d
  1. 10
      src/python/magnum/platform/egl.cpp
  2. 10
      src/python/magnum/platform/glfw.cpp
  3. 10
      src/python/magnum/platform/glx.cpp
  4. 10
      src/python/magnum/platform/sdl2.cpp

10
src/python/magnum/platform/egl.cpp

@ -42,11 +42,21 @@ void egl(py::module& m) {
explicit PyWindowlessApplication(const Configuration& configuration = Configuration{}): Platform::WindowlessApplication{Arguments{argc, nullptr}, configuration} {}
int exec() override {
#ifdef __clang__
/* ugh pybind don't tell me I AM THE FIRST ON EARTH to get a
warning here. Why there's no PYBIND11_OVERLOAD_PURE_NAME_ARG()
variant *with* arguments and one without? */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
PYBIND11_OVERLOAD_PURE_NAME(
int,
PyWindowlessApplication,
"exec",
);
#ifdef __clang__
#pragma GCC diagnostic pop
#endif
}
};

10
src/python/magnum/platform/glfw.cpp

@ -51,12 +51,22 @@ void glfw(py::module& m) {
using PublicizedApplication::PublicizedApplication;
void drawEvent() override {
#ifdef __clang__
/* ugh pybind don't tell me I AM THE FIRST ON EARTH to get a
warning here. Why there's no PYBIND11_OVERLOAD_PURE_NAME_ARG()
variant *with* arguments and one without? */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
PYBIND11_OVERLOAD_PURE_NAME(
void,
PublicizedApplication,
"draw_event",
drawEvent
);
#ifdef __clang__
#pragma GCC diagnostic pop
#endif
}
void mousePressEvent(MouseEvent& event) override {

10
src/python/magnum/platform/glx.cpp

@ -42,11 +42,21 @@ void glx(py::module& m) {
explicit PyWindowlessApplication(const Configuration& configuration = Configuration{}): Platform::WindowlessApplication{Arguments{argc, nullptr}, configuration} {}
int exec() override {
#ifdef __clang__
/* ugh pybind don't tell me I AM THE FIRST ON EARTH to get a
warning here. Why there's no PYBIND11_OVERLOAD_PURE_NAME_ARG()
variant *with* arguments and one without? */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
PYBIND11_OVERLOAD_PURE_NAME(
int,
PyWindowlessApplication,
"exec",
);
#ifdef __clang__
#pragma GCC diagnostic pop
#endif
}
};

10
src/python/magnum/platform/sdl2.cpp

@ -51,12 +51,22 @@ void sdl2(py::module& m) {
using PublicizedApplication::PublicizedApplication;
void drawEvent() override {
#ifdef __clang__
/* ugh pybind don't tell me I AM THE FIRST ON EARTH to get a
warning here. Why there's no PYBIND11_OVERLOAD_PURE_NAME_ARG()
variant *with* arguments and one without? */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
PYBIND11_OVERLOAD_PURE_NAME(
void,
PublicizedApplication,
"draw_event",
drawEvent
);
#ifdef __clang__
#pragma GCC diagnostic pop
#endif
}
/* PYBIND11_OVERLOAD_NAME() calls object_api::operator() with implicit

Loading…
Cancel
Save