From 962e9c7d164f9de4090294ff2f48d4a69aa5a3c4 Mon Sep 17 00:00:00 2001 From: Henrique Date: Thu, 12 Jul 2012 00:21:10 -0300 Subject: [PATCH] Allow logger usage on console applications --- src/framework/CMakeLists.txt | 1 + src/framework/core/eventdispatcher.cpp | 1 - src/framework/core/logger.cpp | 2 ++ src/framework/thirdparty/lbitlib-5.2.0-backport4.cpp | 2 -- src/otclient/CMakeLists.txt | 1 + 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/framework/CMakeLists.txt b/src/framework/CMakeLists.txt index ada43e10..63736ecf 100644 --- a/src/framework/CMakeLists.txt +++ b/src/framework/CMakeLists.txt @@ -6,6 +6,7 @@ ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6) # add framework cmake modules SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake;${CMAKE_MODULE_PATH}") +ADD_DEFINITIONS(-DFRAMEWORK) OPTION(CRASH_HANDLER "Generate crash reports" ON) OPTION(LUAJIT "Use lua jit" OFF) OPTION(USE_STATIC_LIBS "Don't use shared libraries (dlls)" ON) diff --git a/src/framework/core/eventdispatcher.cpp b/src/framework/core/eventdispatcher.cpp index 7c4185fa..cc5cb9f2 100644 --- a/src/framework/core/eventdispatcher.cpp +++ b/src/framework/core/eventdispatcher.cpp @@ -27,7 +27,6 @@ EventDispatcher g_dispatcher; - void EventDispatcher::flush() { while(!m_eventList.empty()) diff --git a/src/framework/core/logger.cpp b/src/framework/core/logger.cpp index f46c9e98..fcf70b8f 100644 --- a/src/framework/core/logger.cpp +++ b/src/framework/core/logger.cpp @@ -61,7 +61,9 @@ void Logger::log(Fw::LogLevel level, const std::string& message) } if(level == Fw::LogFatal) { +#ifdef OTCLIENT g_window.displayFatalError(message); +#endif ignoreLogs = true; exit(-1); } diff --git a/src/framework/thirdparty/lbitlib-5.2.0-backport4.cpp b/src/framework/thirdparty/lbitlib-5.2.0-backport4.cpp index 3112574f..453eb95c 100644 --- a/src/framework/thirdparty/lbitlib-5.2.0-backport4.cpp +++ b/src/framework/thirdparty/lbitlib-5.2.0-backport4.cpp @@ -368,8 +368,6 @@ static const luaL_Reg bitlib[] = { {NULL, NULL} }; - - int luaopen_bit32 (lua_State *L) { luaL_newlib(L, bitlib); return 1; diff --git a/src/otclient/CMakeLists.txt b/src/otclient/CMakeLists.txt index 693778bf..9ed9fb32 100644 --- a/src/otclient/CMakeLists.txt +++ b/src/otclient/CMakeLists.txt @@ -4,6 +4,7 @@ IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6) ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6) # otclient options +ADD_DEFINITIONS(-DOTCLIENT) OPTION(BOT_PROTECTION "Enable bot protection" ON) SET(PROTOCOL 860 CACHE "Protocol version" STRING) OPTION(CIPSOFT_RSA "Use cipsoft RSA to login into original tibia" OFF)