Commit 2ad107fb7acc6384b9eddb9b9071b012933696c8

Authored by Jay Berkenbilt
1 parent 5d1f0bee

binary stdout on windows


git-svn-id: svn+q:///qpdf/trunk@680 71b93d88-0707-0410-a8cf-f5a4172ac649
Showing 1 changed file with 4 additions and 1 deletions
zlib-flate/zlib-flate.cc
1 -  
2 #include <qpdf/Pl_Flate.hh> 1 #include <qpdf/Pl_Flate.hh>
3 #include <qpdf/Pl_StdioFile.hh> 2 #include <qpdf/Pl_StdioFile.hh>
4 3
@@ -6,6 +5,7 @@ @@ -6,6 +5,7 @@
6 #include <string.h> 5 #include <string.h>
7 #include <iostream> 6 #include <iostream>
8 #include <stdlib.h> 7 #include <stdlib.h>
  8 +#include <fcntl.h>
9 #ifdef _WIN32 9 #ifdef _WIN32
10 # include <io.h> 10 # include <io.h>
11 #else 11 #else
@@ -63,6 +63,9 @@ int main(int argc, char* argv[]) @@ -63,6 +63,9 @@ int main(int argc, char* argv[])
63 usage(); 63 usage();
64 } 64 }
65 65
  66 +#ifdef _WIN32
  67 + _setmode(_fileno(stdout), _O_BINARY);
  68 +#endif
66 Pl_StdioFile* out = new Pl_StdioFile("stdout", stdout); 69 Pl_StdioFile* out = new Pl_StdioFile("stdout", stdout);
67 Pl_Flate* flate = new Pl_Flate("flate", out, action); 70 Pl_Flate* flate = new Pl_Flate("flate", out, action);
68 71