Skip to content

Commit 67df4f8

Browse files
committed
Fixing hstring
1 parent 894a870 commit 67df4f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/inc/sys_string/impl/platforms/windows_hstring.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,8 @@ namespace sysstr::util
439439
template<util::ct_string Str>
440440
inline auto make_static_sys_string_hstring() noexcept -> sys_string_hstring
441441
{
442-
static struct bug_workaround { const hstring_header header{1, Str.size() - 1, 0, 0, Str.chars}; } b;
442+
constexpr size_t size = Str.size();
443+
static struct bug_workaround { const hstring_header header{1, size - 1, 0, 0, Str.chars}; } b;
443444
return sys_string_hstring(HSTRING(uintptr_t(&b.header) | hstring_static_allocation_bit) , handle_retain::no);
444445
}
445446
}

0 commit comments

Comments
 (0)