summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index b2027ee..e849b82 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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));