From 2aa4e734dcdd4461734ecc99326c37d5d146f263 Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Mon, 2 Oct 2023 09:38:17 +0200 Subject: [PATCH] Fixing the problem with ::fileno() being deprecated on Windows and replacing it with _fileno() --- Source/messaging/ConsoleStreamRedirect.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Source/messaging/ConsoleStreamRedirect.h b/Source/messaging/ConsoleStreamRedirect.h index d77ea8fcd..d47f8ed59 100644 --- a/Source/messaging/ConsoleStreamRedirect.h +++ b/Source/messaging/ConsoleStreamRedirect.h @@ -61,7 +61,11 @@ namespace WPEFramework { private: ConsoleStandardOut() - : Core::TextStreamRedirectType(::fileno(stdout)) { +#ifdef __WINDOWS__ + : Core::TextStreamRedirectType(::_fileno(stdout)) { +#else + : Core::TextStreamRedirectType(STDOUT_FILENO) { +#endif } public: @@ -84,7 +88,11 @@ namespace WPEFramework { private: ConsoleStandardError() - : Core::TextStreamRedirectType(::fileno(stderr)) { +#ifdef __WINDOWS__ + : Core::TextStreamRedirectType(::_fileno(stderr)) { +#else + : Core::TextStreamRedirectType(STDERR_FILENO) { +#endif } public: