From ca6a3f8116538be122c4208343d8fac78df6c5e1 Mon Sep 17 00:00:00 2001 From: Tetsuya Hayashi Date: Sun, 25 Feb 2024 22:39:14 +0900 Subject: [PATCH] fix windows clang-cl build error #399 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. --- quill/include/quill/detail/Serialize.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quill/include/quill/detail/Serialize.h b/quill/include/quill/detail/Serialize.h index bf7df29c3..6b85c28dd 100644 --- a/quill/include/quill/detail/Serialize.h +++ b/quill/include/quill/detail/Serialize.h @@ -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