This commit is contained in:
Adam D. Ruppe 2016-09-15 12:04:08 -04:00
parent 169a478506
commit ccdb70c656
1 changed files with 4 additions and 1 deletions

5
cgi.d
View File

@ -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();