Skip to content

Commit

Permalink
fix windows clang-cl build error #399
Browse files Browse the repository at this point in the history
This fix build error: constexpr variable 'strnlen' must be initialized by a constant expression.
The reason for the error is that __STDC_LIB_EXT1__ is defined in MSVC but undefined in clang-cl.exe, and strnlen() seems incompatible with constexpr.
  • Loading branch information
tetsuh committed Feb 25, 2024
1 parent 99d115b commit ca6a3f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quill/include/quill/detail/Serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace detail
{

constexpr auto strnlen =
#ifdef __STDC_LIB_EXT1__
#if defined(__STDC_LIB_EXT1__) || defined(_MSC_VER)
::strnlen_s
#else
::strnlen
Expand Down

0 comments on commit ca6a3f8

Please sign in to comment.