Skip to content

Commit 3ec0b62

Browse files
mhaynieclaude
andcommitted
fix: Remove conflicting StringMaker definitions and fix ODR violation
- Remove StringMaker<std::string_view> from text_memstream_test.cpp - Remove StringMaker<std::byte> from data_bits_test.cpp - Catch2 v3 provides these definitions already - Add MH_COMPILE_LIBRARY_INLINE to thread_local static definition Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent deb1212 commit 3ec0b62

File tree

3 files changed

+1
-21
lines changed

3 files changed

+1
-21
lines changed

cpp/include/mh/concurrency/dispatcher.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ namespace mh
419419
}
420420

421421
// Static member definition
422-
thread_local dispatcher* dispatcher::s_current_thread_dispatcher = nullptr;
422+
MH_COMPILE_LIBRARY_INLINE thread_local dispatcher* dispatcher::s_current_thread_dispatcher = nullptr;
423423

424424
MH_COMPILE_LIBRARY_INLINE void dispatcher::register_for_current_thread()
425425
{

test/data_bits_test.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@
22
#include <catch2/catch_all.hpp>
33
#include "last_include.hpp"
44

5-
// Provide definition for Catch2's declared StringMaker specialization
6-
// Only define when building mh_stuff as standalone project to avoid conflicts
7-
#ifdef MH_STUFF_STANDALONE_BUILD
8-
namespace Catch {
9-
std::string StringMaker<std::byte>::convert(std::byte value) {
10-
return std::to_string(static_cast<unsigned int>(value));
11-
}
12-
}
13-
#endif
14-
155
template<unsigned bits_to_copy, unsigned src_offset, typename TSrc = void, typename TDst = void>
166
static void test_bit_functions(const TSrc* src, const TDst expected)
177
{

test/text_memstream_test.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@
44
#include <cstring>
55
#include "last_include.hpp"
66

7-
// Provide definition for Catch2's declared StringMaker specialization
8-
// Only define when building mh_stuff as standalone project to avoid conflicts
9-
#ifdef MH_STUFF_STANDALONE_BUILD
10-
namespace Catch {
11-
std::string StringMaker<std::string_view>::convert(std::string_view str) {
12-
return std::string(str);
13-
}
14-
}
15-
#endif
16-
177
TEST_CASE("memstream put", "[text][memstream]")
188
{
199
char buf[128];

0 commit comments

Comments
 (0)