2
0
mirror of https://github.com/gabime/spdlog.git synced 2026-01-19 04:52:09 +00:00

Fix UWP detection. (#3489)

* Fix UWP detection.

* Fix conditional compilation for getenv function

---------

Co-authored-by: Jérémie Dumas <jedumas@adobe.com>
This commit is contained in:
Jérémie Dumas
2025-11-17 12:34:37 -08:00
committed by GitHub
parent cdbd64e230
commit 8806ca6509

View File

@@ -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);