#include <string.h>
-#ifdef _WIN32
-#include <fcntl.h>
-#include <io.h>
-#endif
-
#include "pickle.hpp"
+#include "os_binary.hpp"
+
#include "cli.hpp"
#include "cli_pager.hpp"
}
}
-#ifdef _WIN32
- // Set stdout in binary mode
- fflush(stdout);
- int mode = _setmode(_fileno(stdout), _O_BINARY);
- if (mode == -1) {
- std::cerr << "warning: failed to set stdout in binary mode\n";
- }
-#endif
+ os::setBinaryMode(stdout);
for (; i < argc; ++i) {
trace::Parser parser;
}
}
-#ifdef _WIN32
- std::cout.flush();
- fflush(stdout);
- if (mode != -1) {
- _setmode(_fileno(stdout), mode);
- }
-#endif
-
return 0;
}