[brlcad-commits] SF.net SVN: brlcad:[60016] brlcad/trunk/src/util
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <bo...@us...> - 2014-02-28 21:53:34
|
Revision: 60016 http://sourceforge.net/p/brlcad/code/60016 Author: bob1961 Date: 2014-02-28 21:53:29 +0000 (Fri, 28 Feb 2014) Log Message: ----------- When on windows we need to arrange for stdin, stdout and stderr to be in binary mode. This fixes the breakage of bw-pix and pix-bw on windows. Modified Paths: -------------- brlcad/trunk/src/util/bw-pix.c brlcad/trunk/src/util/pix-bw.c Modified: brlcad/trunk/src/util/bw-pix.c =================================================================== --- brlcad/trunk/src/util/bw-pix.c 2014-02-28 21:50:32 UTC (rev 60015) +++ brlcad/trunk/src/util/bw-pix.c 2014-02-28 21:53:29 UTC (rev 60016) @@ -94,6 +94,12 @@ return 1; } +#if defined(_WIN32) && !defined(__CYGWIN__) + setmode(fileno(stdin), O_BINARY); + setmode(fileno(stdout), O_BINARY); + setmode(fileno(stderr), O_BINARY); +#endif + img = icv_read(in_file, ICV_IMAGE_BW, inx, iny); if (img == NULL) return 1; Modified: brlcad/trunk/src/util/pix-bw.c =================================================================== --- brlcad/trunk/src/util/pix-bw.c 2014-02-28 21:50:32 UTC (rev 60015) +++ brlcad/trunk/src/util/pix-bw.c 2014-02-28 21:53:29 UTC (rev 60016) @@ -150,6 +150,13 @@ bu_log("%s", usage); return 1; } + +#if defined(_WIN32) && !defined(__CYGWIN__) + setmode(fileno(stdin), O_BINARY); + setmode(fileno(stdout), O_BINARY); + setmode(fileno(stderr), O_BINARY); +#endif + img = icv_read(in_file, ICV_IMAGE_PIX, inx, iny); if (img == NULL) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |