mirror of
https://github.com/libretro/RetroArch
synced 2025-03-17 10:21:26 +00:00
Merge pull request #3760 from fr500/master
make the console toggleable at runtime instead of compilation time
This commit is contained in:
commit
f0ce4389fd
4
Makefile
4
Makefile
@ -63,6 +63,10 @@ else
|
||||
OPTIMIZE_FLAG = -O3 -ffast-math
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
LDFLAGS += -mwindows
|
||||
endif
|
||||
|
||||
CFLAGS += -Wall $(OPTIMIZE_FLAG) $(INCLUDE_DIRS) $(DEBUG_FLAG) -I.
|
||||
|
||||
APPEND_CFLAGS := $(CFLAGS)
|
||||
|
15
verbosity.c
15
verbosity.c
@ -26,6 +26,10 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
@ -50,11 +54,22 @@ static bool main_verbosity = false;
|
||||
void verbosity_enable(void)
|
||||
{
|
||||
main_verbosity = true;
|
||||
#ifdef _WIN32
|
||||
AllocConsole();
|
||||
AttachConsole( GetCurrentProcessId()) ;
|
||||
freopen( "CON", "w", stdout );
|
||||
freopen( "CON", "w", stderr );
|
||||
#endif
|
||||
}
|
||||
|
||||
void verbosity_disable(void)
|
||||
{
|
||||
main_verbosity = false;
|
||||
#ifdef _WIN32
|
||||
HWND wnd = GetConsoleWindow();
|
||||
FreeConsole();
|
||||
PostMessage(wnd, WM_CLOSE, 0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool verbosity_is_enabled(void)
|
||||
|
Loading…
x
Reference in New Issue
Block a user