1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-12-16 14:17:24 -05:00

build: Add missing includes

Fixes #2614
Ref: https://gcc.gnu.org/gcc-12/porting_to.html
This commit is contained in:
patrick96 2022-03-02 14:58:47 +01:00 committed by Patrick Ziegler
parent 4350e356a7
commit 24e079afef
8 changed files with 30 additions and 19 deletions

View file

@ -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

View file

@ -5,6 +5,7 @@
#include <algorithm>
#include <cmath>
#include <deque>
#include <iterator>
#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<pair<double, double>> 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

View file

@ -2,6 +2,8 @@
#include "common.hpp"
#include <array>
POLYBAR_NS
/**

View file

@ -1,5 +1,6 @@
#pragma once
#include <atomic>
#include <ctime>
#include <iomanip>
#include <iostream>
@ -44,6 +45,6 @@ namespace modules {
std::atomic<bool> m_toggled{false};
};
} // namespace modules
} // namespace modules
POLYBAR_NS_END

View file

@ -1,7 +1,5 @@
#pragma once
#include <utility>
#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

View file

@ -1,5 +1,7 @@
#pragma once
#include <atomic>
#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<bool> m_offline{false};
};
} // namespace modules
} // namespace modules
POLYBAR_NS_END

View file

@ -1,9 +1,10 @@
#include "adapters/net.hpp"
#include <linux/nl80211.h>
#include <netlink/genl/ctrl.h>
#include <netlink/genl/genl.h>
#include <algorithm>
#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<char*>(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

View file

@ -3,6 +3,7 @@
#include <sys/statvfs.h>
#include <fstream>
#include <utility>
#include "drawtypes/label.hpp"
#include "drawtypes/progressbar.hpp"
@ -206,6 +207,6 @@ namespace modules {
return true;
}
} // namespace modules
} // namespace modules
POLYBAR_NS_END