Skip to content

Commit

Permalink
Fixing the problem with ::fileno() being deprecated on Windows and re…
Browse files Browse the repository at this point in the history
…placing it with _fileno()
  • Loading branch information
VeithMetro committed Oct 2, 2023
1 parent 9a0a11d commit 2aa4e73
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Source/messaging/ConsoleStreamRedirect.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ namespace WPEFramework {

private:
ConsoleStandardOut()
: Core::TextStreamRedirectType<StandardOut>(::fileno(stdout)) {
#ifdef __WINDOWS__
: Core::TextStreamRedirectType<StandardOut>(::_fileno(stdout)) {
#else
: Core::TextStreamRedirectType<StandardOut>(STDOUT_FILENO) {
#endif
}

public:
Expand All @@ -84,7 +88,11 @@ namespace WPEFramework {

private:
ConsoleStandardError()
: Core::TextStreamRedirectType<StandardError>(::fileno(stderr)) {
#ifdef __WINDOWS__
: Core::TextStreamRedirectType<StandardError>(::_fileno(stderr)) {
#else
: Core::TextStreamRedirectType<StandardError>(STDERR_FILENO) {
#endif
}

public:
Expand Down

0 comments on commit 2aa4e73

Please sign in to comment.