From 5c9e9a52e194c7dfd30df18f6064e7068d3a740d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Mon, 17 Feb 2020 19:17:25 -0300 Subject: [PATCH] QGCMAVLink: Add compiler check to avoid pragma warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MSVC warns about not identified pragmas Signed-off-by: Patrick José Pereira --- src/comm/QGCMAVLink.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/comm/QGCMAVLink.h b/src/comm/QGCMAVLink.h index e5810a75a..202fee0eb 100644 --- a/src/comm/QGCMAVLink.h +++ b/src/comm/QGCMAVLink.h @@ -21,16 +21,22 @@ #include // Hack workaround for Mav 2.0 header problem with respect to offsetof usage // Ignore warnings from mavlink headers for both GCC/Clang and MSVC +#ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Waddress-of-packed-member" +#else #pragma warning(push, 0) +#endif #include extern mavlink_status_t m_mavlink_status[MAVLINK_COMM_NUM_BUFFERS]; #include +#ifdef __GNUC__ #pragma GCC diagnostic pop +#else #pragma warning(pop, 0) +#endif class QGCMAVLink { public: -- 2.22.0