Skip to content

Commit b31205e

Browse files
committed
fix build on linux
Signed-off-by: Marc Bestmann <[email protected]>
1 parent 5fee9e2 commit b31205e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/logging.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ bool g_rcutils_logging_initialized = false;
8787
static char g_rcutils_logging_output_format_string[RCUTILS_LOGGING_MAX_OUTPUT_FORMAT_LEN];
8888
static const char * g_rcutils_logging_default_output_format =
8989
"[{severity}] [{time}] [{name}]: {message}";
90+
#ifdef _WIN32
9091
static DWORD g_original_console_mode = 0;
9192
static bool g_consol_mode_modified = false;
93+
#endif
9294

9395
static rcutils_allocator_t g_rcutils_logging_allocator;
9496

@@ -793,9 +795,11 @@ rcutils_ret_t rcutils_logging_shutdown(void)
793795
g_num_log_msg_handlers = 0;
794796
g_rcutils_logging_initialized = false;
795797

798+
#ifdef _WIN32
796799
if (g_consol_mode_modified){
797800
SetConsoleMode(GetStdHandle(STD_ERROR_HANDLE), g_original_console_mode);
798801
}
802+
#endif
799803
return ret;
800804
}
801805

0 commit comments

Comments
 (0)