From d9ae12d386bd8742c7b7873ddfc6184ac5cebf76 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 6 Mar 2024 21:06:55 -0600 Subject: [PATCH] Fix compile for older gcc and clang std libraries. --- src/engine/mod_summary.cpp | 12 +++--------- src/engine/mod_summary.h | 1 + 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/engine/mod_summary.cpp b/src/engine/mod_summary.cpp index 1e6eafbbf6..1b23d04cd6 100644 --- a/src/engine/mod_summary.cpp +++ b/src/engine/mod_summary.cpp @@ -8,14 +8,12 @@ Distributed under the Boost Software License, Version 1.0. #include "output.h" -#include - namespace b2 { void summary::group(value_ref group) { group_order.push_back(group); - groups.emplace(group, new std::vector); + groups.emplace(group, group_t(new group_t::element_type)); } void summary::message(value_ref group, value_ref message) @@ -23,17 +21,13 @@ 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) diff --git a/src/engine/mod_summary.h b/src/engine/mod_summary.h index d6b43b4311..9b7f0ca619 100644 --- a/src/engine/mod_summary.h +++ b/src/engine/mod_summary.h @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include "bind.h" #include "value.h" +#include #include #include