mirror of
https://github.com/krawieck/lemmur/
synced 2024-12-16 18:39:21 +01:00
23 lines
469 B
C++
23 lines
469 B
C++
#include "utils.h"
|
|
|
|
#include <flutter_windows.h>
|
|
#include <io.h>
|
|
#include <stdio.h>
|
|
#include <windows.h>
|
|
|
|
#include <iostream>
|
|
|
|
void CreateAndAttachConsole() {
|
|
if (::AllocConsole()) {
|
|
FILE *unused;
|
|
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
|
|
_dup2(_fileno(stdout), 1);
|
|
}
|
|
if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
|
|
_dup2(_fileno(stdout), 2);
|
|
}
|
|
std::ios::sync_with_stdio();
|
|
FlutterDesktopResyncOutputStreams();
|
|
}
|
|
}
|