From 24e079afef2d7d515079721d93df4bb39c6e80bd Mon Sep 17 00:00:00 2001 From: patrick96 Date: Wed, 2 Mar 2022 14:58:47 +0100 Subject: [PATCH] build: Add missing includes Fixes #2614 Ref: https://gcc.gnu.org/gcc-12/porting_to.html --- CHANGELOG.md | 3 ++- include/cairo/context.hpp | 19 ++++++++++++------- include/ipc/msg.hpp | 2 ++ include/modules/date.hpp | 3 ++- include/modules/fs.hpp | 4 +--- include/modules/github.hpp | 4 +++- src/adapters/net_nl.cpp | 11 ++++++----- src/modules/fs.cpp | 3 ++- 8 files changed, 30 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42e9920f..c51311fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Build -- Compiler warning in clang-13 ([`#2613`](https://github.com/polybar/polybar/pull/2613)) +- Fixed compiler warning in Clang 13 ([`#2613`](https://github.com/polybar/polybar/pull/2613)) +- Fixed compiler error in GCC 12 ([`#2616`](https://github.com/polybar/polybar/pull/2616), [`#2614`](https://github.com/polybar/polybar/issues/2614)) ## [3.6.0] - 2022-03-01 ### Breaking diff --git a/include/cairo/context.hpp b/include/cairo/context.hpp index a937cd72..f0be75bc 100644 --- a/include/cairo/context.hpp +++ b/include/cairo/context.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "cairo/font.hpp" #include "cairo/surface.hpp" @@ -117,9 +118,12 @@ namespace cairo { context& operator<<(const rounded_corners& c) { cairo_new_sub_path(m_c); - cairo_arc(m_c, c.x + c.w - c.radius.top_right, c.y + c.radius.top_right, c.radius.top_right, -90 * degree, 0 * degree); - cairo_arc(m_c, c.x + c.w - c.radius.bottom_right, c.y + c.h - c.radius.bottom_right, c.radius.bottom_right, 0 * degree, 90 * degree); - cairo_arc(m_c, c.x + c.radius.bottom_left, c.y + c.h - c.radius.bottom_left, c.radius.bottom_left, 90 * degree, 180 * degree); + cairo_arc( + m_c, c.x + c.w - c.radius.top_right, c.y + c.radius.top_right, c.radius.top_right, -90 * degree, 0 * degree); + cairo_arc(m_c, c.x + c.w - c.radius.bottom_right, c.y + c.h - c.radius.bottom_right, c.radius.bottom_right, + 0 * degree, 90 * degree); + cairo_arc(m_c, c.x + c.radius.bottom_left, c.y + c.h - c.radius.bottom_left, c.radius.bottom_left, 90 * degree, + 180 * degree); cairo_arc(m_c, c.x + c.radius.top_left, c.y + c.radius.top_left, c.radius.top_left, 180 * degree, 270 * degree); cairo_close_path(m_c); return *this; @@ -142,7 +146,8 @@ namespace cairo { cairo_rel_line_to(m_c, 0, segment.w); break; } - cairo_arc_negative(m_c, segment.x, segment.y, segment.radius - segment.w, segment.angle_to * degree, segment.angle_from * degree); + cairo_arc_negative(m_c, segment.x, segment.y, segment.radius - segment.w, segment.angle_to * degree, + segment.angle_from * degree); cairo_close_path(m_c); return *this; } @@ -360,9 +365,9 @@ namespace cairo { std::deque> m_points; int m_activegroups{0}; - private: - const double degree = M_PI / 180.0; + private: + const double degree = M_PI / 180.0; }; -} // namespace cairo +} // namespace cairo POLYBAR_NS_END diff --git a/include/ipc/msg.hpp b/include/ipc/msg.hpp index 9cc9b508..1b37022d 100644 --- a/include/ipc/msg.hpp +++ b/include/ipc/msg.hpp @@ -2,6 +2,8 @@ #include "common.hpp" +#include + POLYBAR_NS /** diff --git a/include/modules/date.hpp b/include/modules/date.hpp index ee5c5a79..296ec276 100644 --- a/include/modules/date.hpp +++ b/include/modules/date.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -44,6 +45,6 @@ namespace modules { std::atomic m_toggled{false}; }; -} // namespace modules +} // namespace modules POLYBAR_NS_END diff --git a/include/modules/fs.hpp b/include/modules/fs.hpp index 2de51340..c67663ce 100644 --- a/include/modules/fs.hpp +++ b/include/modules/fs.hpp @@ -1,7 +1,5 @@ #pragma once -#include - #include "components/config.hpp" #include "modules/meta/timer_module.hpp" #include "settings.hpp" @@ -74,6 +72,6 @@ namespace modules { // used while formatting output size_t m_index{0_z}; }; -} // namespace modules +} // namespace modules POLYBAR_NS_END diff --git a/include/modules/github.hpp b/include/modules/github.hpp index a45701f5..bb70bf8c 100644 --- a/include/modules/github.hpp +++ b/include/modules/github.hpp @@ -1,5 +1,7 @@ #pragma once +#include + #include "modules/meta/timer_module.hpp" #include "settings.hpp" #include "utils/http.hpp" @@ -37,6 +39,6 @@ namespace modules { bool m_empty_notifications{false}; std::atomic m_offline{false}; }; -} // namespace modules +} // namespace modules POLYBAR_NS_END diff --git a/src/adapters/net_nl.cpp b/src/adapters/net_nl.cpp index 0a72601a..b62f45bc 100644 --- a/src/adapters/net_nl.cpp +++ b/src/adapters/net_nl.cpp @@ -1,9 +1,10 @@ -#include "adapters/net.hpp" - #include #include #include +#include + +#include "adapters/net.hpp" #include "utils/file.hpp" POLYBAR_NS @@ -166,8 +167,8 @@ namespace net { m_essid.clear(); if (bss[NL80211_BSS_INFORMATION_ELEMENTS] != nullptr) { - // Information Element ID from ieee80211.h - #define WLAN_EID_SSID 0 +// Information Element ID from ieee80211.h +#define WLAN_EID_SSID 0 auto ies = static_cast(nla_data(bss[NL80211_BSS_INFORMATION_ELEMENTS])); auto ies_len = nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]); @@ -226,6 +227,6 @@ namespace net { m_signalstrength.max = hardware_max - hardware_min; } } -} // namespace net +} // namespace net POLYBAR_NS_END diff --git a/src/modules/fs.cpp b/src/modules/fs.cpp index d792bd72..e13ef443 100644 --- a/src/modules/fs.cpp +++ b/src/modules/fs.cpp @@ -3,6 +3,7 @@ #include #include +#include #include "drawtypes/label.hpp" #include "drawtypes/progressbar.hpp" @@ -206,6 +207,6 @@ namespace modules { return true; } -} // namespace modules +} // namespace modules POLYBAR_NS_END