diff --git a/include/spdlog/details/os-inl.h b/include/spdlog/details/os-inl.h index f03cf310..6f5ee52b 100644 --- a/include/spdlog/details/os-inl.h +++ b/include/spdlog/details/os-inl.h @@ -130,7 +130,7 @@ SPDLOG_INLINE void prevent_child_fd(FILE *f) { #ifdef _WIN32 -#if !defined(__cplusplus_winrt) +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) auto file_handle = reinterpret_cast(_get_osfhandle(::_fileno(f))); if (!::SetHandleInformation(file_handle, HANDLE_FLAG_INHERIT, 0)) SPDLOG_THROW(spdlog_ex("SetHandleInformation failed", errno));