Skip to content

Commit 7342eba

Browse files
committed
Fix build for other compilers
Signed-off-by: Alexander Krimm <[email protected]>
1 parent 608c594 commit 7342eba

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

src/client/test/CMakeLists.txt

+10-10
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ if(NOT EMSCRIPTEN)
6565
# TEST_PREFIX to whatever you want, or use different for different binaries catch_discover_tests(client_tests
6666
# TEST_PREFIX "unittests." REPORTER xml OUTPUT_DIR . OUTPUT_PREFIX "unittests." OUTPUT_SUFFIX .xml)
6767
catch_discover_tests(clientPublisher_tests)
68+
69+
add_executable(CmwLightTest catch_main.cpp CmwLightTest.cpp)
70+
target_link_libraries(
71+
CmwLightTest
72+
PUBLIC opencmw_project_warnings
73+
opencmw_project_options
74+
Catch2::Catch2
75+
client)
76+
target_include_directories(CmwLightTest PRIVATE ${CMAKE_SOURCE_DIR})
77+
catch_discover_tests(CmwLightTest)
6878
endif()
6979

7080
add_executable(rest_client_only_tests RestClientOnly_tests.cpp)
@@ -73,16 +83,6 @@ target_include_directories(rest_client_only_tests PRIVATE ${CMAKE_SOURCE_DIR})
7383
# This test requires a different kind of invocation as it needs the server running
7484
# catch_discover_tests(rest_client_only_tests)
7585

76-
add_executable(CmwLightTest catch_main.cpp CmwLightTest.cpp)
77-
target_link_libraries(
78-
CmwLightTest
79-
PUBLIC opencmw_project_warnings
80-
opencmw_project_options
81-
Catch2::Catch2
82-
client)
83-
target_include_directories(CmwLightTest PRIVATE ${CMAKE_SOURCE_DIR})
84-
catch_discover_tests(CmwLightTest)
85-
8686
if(EMSCRIPTEN)
8787
add_executable(emscripten_client_tests EmscriptenClientTests.cpp)
8888
target_link_libraries(

src/core/include/SpinWait.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <cstdint>
55
#include <functional>
66
#include <thread>
7+
#include <atomic>
78

89
namespace opencmw {
910

src/serialiser/test/IoSerialiserCmwLight_tests.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ static std::string hexview(const std::string_view value, std::size_t bytesPerLin
7777
result.reserve(value.size() * 4);
7878
std::string alpha; // temporarily store the ascii representation
7979
alpha.reserve(8 * bytesPerLine);
80-
for (auto [i, c] : std::ranges::views::enumerate(value)) {
80+
std::size_t i = 0;
81+
for (auto c : value) {
8182
if (i % (bytesPerLine * 8) == 0) {
8283
result.append(fmt::format("{0:#08x} - {0:04} | ", i)); // print address in hex and decimal
8384
}
@@ -91,6 +92,7 @@ static std::string hexview(const std::string_view value, std::size_t bytesPerLin
9192
result.append(fmt::format(" {}\n", alpha));
9293
alpha.clear();
9394
}
95+
i++;
9496
}
9597
result.append(fmt::format("{:{}} {}\n", "", 3 * (9 * bytesPerLine - alpha.size()), alpha));
9698
return result;

0 commit comments

Comments
 (0)