Skip to content

Commit

Permalink
core: Add libc++ compatibility (#73)
Browse files Browse the repository at this point in the history
src/renderer/AsyncResourceGatherer.cpp:98:22: error: no viable overloaded '+='
   98 |             progress += 1.0 / (preloads + 1.0);
      |             ~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~
src/renderer/widgets/IWidget.cpp:41:44: error: no member named 'current_zone' in namespace 'std::chrono'
   41 |     const auto current_zone = std::chrono::current_zone();
      |                               ~~~~~~~~~~~~~^
  • Loading branch information
jbeich authored Feb 23, 2024
1 parent 4c68780 commit 8969351
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/renderer/AsyncResourceGatherer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ void CAsyncResourceGatherer::gather() {
progress = 0;
for (auto& c : CWIDGETS) {
if (c.type == "background") {
#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 180100
progress = progress + 1.0 / (preloads + 1.0);
#else
progress += 1.0 / (preloads + 1.0);
#endif

std::string path = std::any_cast<Hyprlang::STRING>(c.values.at("path"));

Expand Down
10 changes: 10 additions & 0 deletions src/renderer/widgets/IWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
#include <chrono>
#include <unistd.h>

#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 190100
#pragma comment(lib, "date-tz")
#include <date/tz.h>
namespace std {
namespace chrono {
using date::current_zone;
}
}
#endif

Vector2D IWidget::posFromHVAlign(const Vector2D& viewport, const Vector2D& size, const Vector2D& offset, const std::string& halign, const std::string& valign) {
Vector2D pos = offset;
if (halign == "center")
Expand Down

0 comments on commit 8969351

Please sign in to comment.