diff --git a/gucc/src/bootloader.cpp b/gucc/src/bootloader.cpp index b16bfc5..ef17a93 100644 --- a/gucc/src/bootloader.cpp +++ b/gucc/src/bootloader.cpp @@ -4,32 +4,13 @@ #include "gucc/io_utils.hpp" #include "gucc/string_utils.hpp" +#include // for ranges::* + #include #include #include -#if defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wold-style-cast" -#elif defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wnull-dereference" -#pragma GCC diagnostic ignored "-Wuseless-cast" -#pragma GCC diagnostic ignored "-Wold-style-cast" -#endif - -#include -#include -#include -#include - -#if defined(__clang__) -#pragma clang diagnostic pop -#elif defined(__GNUC__) -#pragma GCC diagnostic pop -#endif - using namespace std::string_view_literals; #define CONV_REQ_F(needle, f) \ @@ -182,14 +163,13 @@ auto parse_grub_line(const gucc::bootloader::GrubConfig& grub_config, std::strin namespace gucc::bootloader { auto gen_grub_config(const GrubConfig& grub_config) noexcept -> std::string { - std::string result = GRUB_DEFAULT_CONFIG | ranges::views::split('\n') - | ranges::views::transform([&](auto&& rng) { - auto&& line = std::string_view(&*rng.begin(), static_cast(ranges::distance(rng))); + std::string result = GRUB_DEFAULT_CONFIG | std::ranges::views::split('\n') + | std::ranges::views::transform([&](auto&& rng) { + auto&& line = std::string_view(&*rng.begin(), static_cast(std::ranges::distance(rng))); return parse_grub_line(grub_config, line); }) - | ranges::views::join('\n') - | ranges::to(); - result += '\n'; + | std::ranges::views::join_with('\n') + | std::ranges::to(); return result; }