From eb7fcc9564236df8ee231475c3bff2e8c443ded0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dumas?= Date: Mon, 17 Nov 2025 10:42:12 -0800 Subject: [PATCH] Fix conditional compilation for getenv function --- include/spdlog/details/os-inl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/spdlog/details/os-inl.h b/include/spdlog/details/os-inl.h index 3b116830..a8cc97a7 100644 --- a/include/spdlog/details/os-inl.h +++ b/include/spdlog/details/os-inl.h @@ -567,7 +567,8 @@ SPDLOG_INLINE filename_t dir_name(const filename_t &path) { #pragma warning(disable : 4996) #endif // _MSC_VER std::string SPDLOG_INLINE getenv(const char *field) { -#if defined(_MSC_VER) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) +#if defined(_MSC_VER) && defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_DESKTOP_APP) && \ + (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) return std::string{}; // not supported under uwp #else char *buf = std::getenv(field);