Commit fd5cb6d6 authored by jehan's avatar jehan
Browse files

make sure bctbx_fatal outputs in logcat

parent 26f1c8e0
......@@ -94,6 +94,9 @@ if(ENABLE_STATIC)
if(HAVE_LIBDL)
target_link_libraries(bctoolbox-static INTERFACE dl)
endif()
if(ANDROID)
target_link_libraries(bctoolbox-static INTERFACE log)
endif()
if(ENABLE_TESTS_COMPONENT)
add_library(bctoolbox-tester-static STATIC ${BCTOOLBOX_TESTER_SOURCE_FILES})
set_target_properties(bctoolbox-tester-static PROPERTIES OUTPUT_NAME bctoolbox-tester)
......@@ -149,6 +152,9 @@ if(ENABLE_SHARED)
if(HAVE_LIBDL)
target_link_libraries(bctoolbox PRIVATE dl)
endif()
if(ANDROID)
target_link_libraries(bctoolbox PRIVATE log)
endif()
if(ENABLE_TESTS_COMPONENT)
add_library(bctoolbox-tester SHARED ${BCTOOLBOX_TESTER_SOURCE_FILES})
set_target_properties(bctoolbox-tester PROPERTIES LINKER_LANGUAGE "CXX")
......
......@@ -45,6 +45,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define THREAD_LOG_LEVEL_ENABLED 1
#endif
#ifdef __ANDROID__
#include <android/log.h>
#endif /* __ANDROID__ */
typedef struct{
char *domain;
......@@ -556,7 +559,12 @@ void bctbx_logv(const char *domain, BctbxLogLevel level, const char *fmt, va_lis
#if !defined(_WIN32_WCE)
if (level == BCTBX_LOG_FATAL) {
bctbx_logv_flush();
#ifdef __ANDROID__
//Act as a flush + abort
__android_log_assert(NULL, NULL, "%s", "Aborting");
#else
abort();
#endif
}
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment