mirror of
https://github.com/Genymobile/scrcpy
synced 2025-08-31 06:15:25 +00:00
Disable stdout/stderr buffering on Windows
In MSYS2 on Windows, the output is buffered by default. Disable buffering to print output immediately. Note that in cmd.exe, it still prints nothing.
This commit is contained in:
@@ -233,6 +233,12 @@ static SDL_bool parse_args(struct args *args, int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
#ifdef __WINDOWS__
|
||||
// disable buffering, we want logs immediately
|
||||
// even line buffering (setvbuf() with mode _IOLBF) is not sufficient
|
||||
setbuf(stdout, NULL);
|
||||
setbuf(stderr, NULL);
|
||||
#endif
|
||||
struct args args = {
|
||||
.serial = NULL,
|
||||
.help = SDL_FALSE,
|
||||
|
Reference in New Issue
Block a user