From 8806ca6509f037cf7612ea292338e3b222209dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dumas?= Date: Mon, 17 Nov 2025 12:34:37 -0800 Subject: [PATCH] Fix UWP detection. (#3489) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix UWP detection. * Fix conditional compilation for getenv function --------- Co-authored-by: Jérémie Dumas --- 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 8a2e203c..f7a0a277 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) && defined(__cplusplus_winrt) +#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);