Skip to content
This repository has been archived by the owner on May 17, 2022. It is now read-only.

Commit

Permalink
unit: windows: fix code for 'Windows' version
Browse files Browse the repository at this point in the history
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
  • Loading branch information
ljmf00 committed Sep 21, 2019
1 parent aeff795 commit 65af3fe
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/unit/source/aurorafw/unit/internal/console.d
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ static struct Console {
import core.sys.posix.unistd;
noColours = isatty(STDOUT_FILENO) == 0;
} else version(Windows) {
import core.sys.windows.winbase : GetStdHandle, STD_OUTPUT_HANDLE, INVALID_HANDLE_VALUE;
import core.sys.windows.wincon : SetConsoleOutputCP, GetConsoleMode, SetConsoleMode;
import core.sys.windows.windef : DWORD;
import core.sys.windows.winnls : CP_UTF8;
import core.sys.windows.winbase;
import core.sys.windows.wincon;
import core.sys.windows.windef;
import core.sys.windows.winnls;

SetConsoleOutputCP(CP_UTF8);

Expand All @@ -76,7 +76,8 @@ static struct Console {
}
}

static string colour(T)(T t, Colour c = Colour.none) {
static string colour(T)(T t, Colour c = Colour.none)
{
return noColours
? text(t)
: text("\033[", cast(int) c, "m", t, "\033[m");
Expand Down

0 comments on commit 65af3fe

Please sign in to comment.