]> granicus.if.org Git - icinga2/commitdiff
Tidy up INITIALIZE_ONCE use in console.cpp a bit
authorGunnar Beutner <gunnar.beutner@icinga.com>
Thu, 23 Nov 2017 08:46:06 +0000 (09:46 +0100)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Thu, 30 Nov 2017 16:47:09 +0000 (17:47 +0100)
lib/base/console.cpp

index 0578079956c3b4190ada73ae25fa084f4adc36d9..62dccd2df58eb21222f5b8fe373fdb44090c287c 100644 (file)
@@ -25,8 +25,7 @@ using namespace icinga;
 
 static ConsoleType l_ConsoleType = Console_Dumb;
 
-static void InitializeConsole(void)
-{
+INITIALIZE_ONCE([]() {
        l_ConsoleType = Console_Dumb;
 
 #ifndef _WIN32
@@ -35,9 +34,7 @@ static void InitializeConsole(void)
 #else /* _WIN32 */
        l_ConsoleType = Console_Windows;
 #endif /* _WIN32 */
-}
-
-INITIALIZE_ONCE(InitializeConsole);
+})
 
 ConsoleColorTag::ConsoleColorTag(int color, ConsoleType consoleType)
        : m_Color(color), m_ConsoleType(consoleType)