Re: [x265] [PATCH] fix output to pipe on Windows

2018-02-13 Thread Ashok Kumar Mishra
On Sat, Feb 10, 2018 at 10:49 AM, Ma0  wrote:

> # HG changeset patch
> # User Ma0 
> # Date 1518239805 -3600
> #  Sat Feb 10 06:16:45 2018 +0100
> # Node ID c4d56ef3611d3c157ce81241b655e953d58308f2
> # Parent  1949157705cef7e6e97df116e2f71636f4cb0025
> fix output to pipe on Windows
>
> diff -r 1949157705ce -r c4d56ef3611d source/output/raw.cpp
> --- a/source/output/raw.cpp Wed Jan 31 19:44:19 2018 +0530
> +++ b/source/output/raw.cpp Sat Feb 10 06:16:45 2018 +0100
> @@ -24,6 +24,14 @@
>
>  #include "raw.h"
>
> +#if _WIN32
> +#include 
> +#include 
> +#if defined(_MSC_VER)
> +#pragma warning(disable: 4996) // POSIX setmode and fileno deprecated
> +#endif
> +#endif
> +
>  using namespace X265_NS;
>  using namespace std;
>
> @@ -33,6 +41,9 @@
>  if (!strcmp(fname, "-"))
>  {
>  ofs = stdout;
> +#if _WIN32
> +setmode(fileno(stdout), O_BINARY);
> +#endif
>  return;
>  }
>  ofs = x265_fopen(fname, "wb");
> ___
> x265-devel mailing list
> x265-devel@videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>


Thanks. Pushed to default.
___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel


[x265] [PATCH] fix output to pipe on Windows

2018-02-09 Thread Ma0
# HG changeset patch
# User Ma0 
# Date 1518239805 -3600
#  Sat Feb 10 06:16:45 2018 +0100
# Node ID c4d56ef3611d3c157ce81241b655e953d58308f2
# Parent  1949157705cef7e6e97df116e2f71636f4cb0025
fix output to pipe on Windows

diff -r 1949157705ce -r c4d56ef3611d source/output/raw.cpp
--- a/source/output/raw.cpp Wed Jan 31 19:44:19 2018 +0530
+++ b/source/output/raw.cpp Sat Feb 10 06:16:45 2018 +0100
@@ -24,6 +24,14 @@
 
 #include "raw.h"
 
+#if _WIN32
+#include 
+#include 
+#if defined(_MSC_VER)
+#pragma warning(disable: 4996) // POSIX setmode and fileno deprecated
+#endif
+#endif
+
 using namespace X265_NS;
 using namespace std;
 
@@ -33,6 +41,9 @@
 if (!strcmp(fname, "-"))
 {
 ofs = stdout;
+#if _WIN32
+setmode(fileno(stdout), O_BINARY);
+#endif
 return;
 }
 ofs = x265_fopen(fname, "wb");
___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel