Skip to content

Commit

Permalink
Make Initialize and Shutdown const in MSYS and Cygwin.
Browse files Browse the repository at this point in the history
  • Loading branch information
JPeterMugaas committed May 21, 2024
1 parent ef69631 commit 4e8c6f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

cmake_minimum_required (VERSION 3.21)

set(EFXC2_VERSION 0.0.10.231)
set(EFXC2_VERSION 0.0.10.232)
project (efxc2 VERSION ${EFXC2_VERSION}
DESCRIPTION "Enhanced fxc2"
HOMEPAGE_URL "https://github.com/JPeterMugaas/efxc2"
Expand Down
10 changes: 8 additions & 2 deletions efxc2Console.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,26 @@ namespace efxc2Console {
"[1;00";
class Console {
public:
void Initialize() {

#ifdef _WIN32
void Initialize() {
std_output = GetStdHandle(STD_OUTPUT_HANDLE);
std_error = GetStdHandle(STD_ERROR_HANDLE);
(void)GetConsoleMode(std_output, &stdout_orig_console_mode);
(void)GetConsoleMode(std_error, &stderr_orig_console_mode);
(void)SetConsoleMode(std_output, stdout_orig_console_mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
(void)SetConsoleMode(std_error, stderr_orig_console_mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
#else
void Initialize() const {
#endif
}
void Shutdown() {

#ifdef _WIN32
void Shutdown() {
(void)SetConsoleMode(std_output, stdout_orig_console_mode);
(void)SetConsoleMode(std_error, stderr_orig_console_mode);
#else
void Shutdown() const {
#endif
}

Expand Down

0 comments on commit 4e8c6f9

Please sign in to comment.