From ccdb70c656b1942a88b1f2a4ede5504f723bd345 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Thu, 15 Sep 2016 12:04:08 -0400 Subject: [PATCH] win64 --- cgi.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cgi.d b/cgi.d index da8ece5..2c84402 100644 --- a/cgi.d +++ b/cgi.d @@ -298,12 +298,15 @@ static: static this() { // Set stdin to binary mode + version(Win64) + _setmode(std.stdio.stdin.fileno(), 0x8000); + else setmode(std.stdio.stdin.fileno(), 0x8000); } T[] rawRead(T)(T[] buf) { uint bytesRead; - auto result = ReadFile(GetStdHandle(STD_INPUT_HANDLE), buf.ptr, buf.length * T.sizeof, &bytesRead, null); + auto result = ReadFile(GetStdHandle(STD_INPUT_HANDLE), buf.ptr, cast(int) (buf.length * T.sizeof), &bytesRead, null); if (!result) { auto err = GetLastError();