diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-12-31 16:44:46 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-12-31 17:14:01 +0100 |
commit | fc9c8eed3d1b7f7608b8451c53b214e502f1b8f1 (patch) | |
tree | 2f36a27f44a2ffb1ee14f0ff8ef3ef9db334800a | |
parent | e9e8fa617a666b9ef36fb47dedb3d0fe96dfca48 (diff) |
Write to stdout in binary mode on Windows
This fixes the output of newlines.
-rw-r--r-- | src/main.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -7,6 +7,11 @@ #include "debug.h" #include "bench.h" +#if defined(_WIN32) && !defined(__CYGWIN__) + #include <io.h> + #include <fcntl.h> +#endif + typedef enum { FORMAT_NONE, FORMAT_HTML, @@ -58,6 +63,10 @@ int main(int argc, char *argv[]) writer_format writer = FORMAT_HTML; long options = CMARK_OPT_DEFAULT; +#if defined(_WIN32) && !defined(__CYGWIN__) + _setmode(_fileno(stdout), _O_BINARY); +#endif + parser = cmark_parser_new(); files = (int *)malloc(argc * sizeof(*files)); |