From 46c51ea3d0a92373bd4cf72482eada0ff03cd013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Wi=C5=9Bniewski?= Date: Fri, 11 Oct 2024 00:19:19 +0200 Subject: [PATCH] Change how sub_source is constructed to fix build on windows --- CMakeLists.txt | 2 +- cpp/gerber/src/parser.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6f7bbc..f9e70cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,7 @@ add_custom_command( ${PROJECT_SOURCE_DIR}/python/pygerber_gerber_parser_cpp/gerber_parser$ ) -CPMAddPackage("gh:catchorg/Catch2@3.3.2") +CPMAddPackage("gh:catchorg/Catch2@3.7.1") add_executable(tests) diff --git a/cpp/gerber/src/parser.cpp b/cpp/gerber/src/parser.cpp index bcbe95e..1fc5742 100644 --- a/cpp/gerber/src/parser.cpp +++ b/cpp/gerber/src/parser.cpp @@ -42,7 +42,7 @@ namespace gerber { } location_t Parser::parse_global(const std::string_view& source, const location_t& index) { - const std::string_view sub_source{source.begin() + index, source.size() - index}; + const std::string_view sub_source = source.substr(index); if (sub_source.empty()) { return 0;