Skip to content

Commit 1da5108

Browse files
linsykingandersfugmann
authored andcommitted
Fix stdin stdout binary mode on Windows
1 parent 4827a0a commit 1da5108

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/plugin/protoc_gen_ocaml.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ let read_all in_channel =
1717

1818
(* Read from stdin *)
1919
let read () =
20+
set_binary_mode_in stdin true;
2021
read_all stdin
2122
|> Ocaml_protoc_plugin.Reader.create
2223
|> Plugin.CodeGeneratorRequest.from_proto_exn
2324

2425
(* Write to stdout *)
2526
let write response =
27+
set_binary_mode_out stdout true;
2628
Plugin.CodeGeneratorResponse.to_proto response
2729
|> Ocaml_protoc_plugin.Writer.contents
2830
|> output_string stdout

0 commit comments

Comments
 (0)