Commit 2ad107fb7acc6384b9eddb9b9071b012933696c8
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 | 1 | #include <qpdf/Pl_Flate.hh> |
| 3 | 2 | #include <qpdf/Pl_StdioFile.hh> |
| 4 | 3 | |
| ... | ... | @@ -6,6 +5,7 @@ |
| 6 | 5 | #include <string.h> |
| 7 | 6 | #include <iostream> |
| 8 | 7 | #include <stdlib.h> |
| 8 | +#include <fcntl.h> | |
| 9 | 9 | #ifdef _WIN32 |
| 10 | 10 | # include <io.h> |
| 11 | 11 | #else |
| ... | ... | @@ -63,6 +63,9 @@ int main(int argc, char* argv[]) |
| 63 | 63 | usage(); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | +#ifdef _WIN32 | |
| 67 | + _setmode(_fileno(stdout), _O_BINARY); | |
| 68 | +#endif | |
| 66 | 69 | Pl_StdioFile* out = new Pl_StdioFile("stdout", stdout); |
| 67 | 70 | Pl_Flate* flate = new Pl_Flate("flate", out, action); |
| 68 | 71 | ... | ... |