Skip to content

Commit

Permalink
Fix compile for older gcc and clang std libraries.
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot committed Mar 7, 2024
1 parent c7943c0 commit d9ae12d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/engine/mod_summary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,26 @@ Distributed under the Boost Software License, Version 1.0.

#include "output.h"

#include <memory>

namespace b2 {

void summary::group(value_ref group)
{
group_order.push_back(group);
groups.emplace(group, new std::vector<value_ref>);
groups.emplace(group, group_t(new group_t::element_type));
}

void summary::message(value_ref group, value_ref message)
{
groups[group]->push_back(message);
}

int summary::count(value_ref group)
{
return (int)(groups[group]->size());
}
int summary::count(value_ref group) { return (int)(groups[group]->size()); }

void summary::print(value_ref group, value_ref format)
{
std::string format_str = format;
auto & g = groups[group];
std::sort(g->begin(), g->end(), [](value_ref a, value_ref b) -> bool
{
std::sort(g->begin(), g->end(), [](value_ref a, value_ref b) -> bool {
return std::strcmp(a->str(), b->str()) < 0;
});
for (auto const & m : *g)
Expand Down
1 change: 1 addition & 0 deletions src/engine/mod_summary.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0.
#include "bind.h"
#include "value.h"

#include <memory>
#include <unordered_map>
#include <vector>

Expand Down

0 comments on commit d9ae12d

Please sign in to comment.