From ca5d87e46d10795f4bf5539b5040a3c568f8a3fa Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 4 Oct 2022 19:44:29 +0200 Subject: [PATCH] disable CONIN$ and CONOUT$ redirection on mingw. it creates issues (nothing printed on the console) It is probably not needed on mingw/msys. --- libs/kiplatform/msw/app.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/kiplatform/msw/app.cpp b/libs/kiplatform/msw/app.cpp index 4fdb54a010..244ff14cd2 100644 --- a/libs/kiplatform/msw/app.cpp +++ b/libs/kiplatform/msw/app.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2020 Mark Roszko -* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors. +* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -68,6 +68,8 @@ bool KIPLATFORM::APP::Init() HANDLE handle; if( AttachConsole( ATTACH_PARENT_PROCESS ) ) { + #if !defined( __MINGW32__ ) // These redirections create problems on mingw: + // Nothing is printed to the console if( GetStdHandle( STD_INPUT_HANDLE ) != INVALID_HANDLE_VALUE ) { freopen( "CONIN$", "r", stdin ); @@ -85,6 +87,7 @@ bool KIPLATFORM::APP::Init() freopen( "CONOUT$", "w", stderr ); setvbuf( stderr, NULL, _IONBF, 0 ); } + #endif std::ios::sync_with_stdio( true );