* @file main/CLI/main.cpp
* @brief The main eVaf CLI application class
*
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
*
* This file is part of the eVaf C++ cross-platform application development framework.
*
*
* This function outputs messages to the console and to the log file.
*/
-static void messageOutput(QtMsgType type, char const * const msg)
+static void messageOutput(QtMsgType type, QMessageLogContext const &, QString const & msg)
{
static bool inHandler = false;
* If the critical error message is shown, then the user has an option to ignore the error. In this
* case the application is not terminated.
*/
-static void fatalMsgHandler(QString const & msg, QString const & source, QString const & where)
+[[noreturn]] static void fatalMsgHandler(QString const & msg, QString const & source, QString const & where)
{
-#ifdef Q_OS_LINUX
- abort();
-#else
+ Q_UNUSED(msg)
+ Q_UNUSED(source)
+ Q_UNUSED(where)
exit(1);
-#endif
}
} // namespace eVaf::CLI::Internal
// Install our onw message handlers
Common::iLogger::instance()->installFatalMsgHandler(Internal::fatalMsgHandler);
- qInstallMsgHandler(Internal::messageOutput);
+ qInstallMessageHandler(Internal::messageOutput);
// Process command-line arguments
if (!Application::processCommandLine(argc, argv))
// The main run loop
bool quit = false;
- int rval;
+ int rval = 0;
while (!quit) {
EVAF_INFO("%s is starting up", VER_MODULE_NAME_STR);