Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e17bfab0 authored by Myles Watson's avatar Myles Watson
Browse files

OS: Use LOG_ALWAYS_FATAL for Android

Test: bluetooth_test_gd --gtest_filter=*Death*
Change-Id: I0aa4e85a7fd000eb90c65c51d3ac372634583c69
parent 54dc2b09
Loading
Loading
Loading
Loading
+15 −12
Original line number Diff line number Diff line
@@ -46,21 +46,24 @@
#define LOG_INFO(...) LOGWRAPPER(__VA_ARGS__)
#define LOG_WARN(...) LOGWRAPPER(__VA_ARGS__)
#define LOG_ERROR(...) LOGWRAPPER(__VA_ARGS__)
#define LOG_ALWAYS_FATAL(...) \
  do {                        \
    LOGWRAPPER(__VA_ARGS__);  \
    abort();                  \
  } while (false)

#endif /* defined(OS_ANDROID) */

#define ASSERT(condition)                                                              \
  do {                                                                                 \
    if (!(condition)) {                                                                \
      LOG_ERROR("%s:%d assertion '" #condition "' failed", __FILE__, __LINE__); \
      abort();                                                                  \
      LOG_ALWAYS_FATAL("%s:%d assertion '" #condition "' failed", __FILE__, __LINE__); \
    }                                                                                  \
  } while (false)

#define ASSERT_LOG(condition, fmt, args...)                                                           \
  do {                                                                                                \
    if (!(condition)) {                                                                               \
      LOG_ERROR("%s:%d assertion '" #condition "' failed - " fmt, __FILE__, __LINE__, ##args); \
      abort();                                                                                 \
      LOG_ALWAYS_FATAL("%s:%d assertion '" #condition "' failed - " fmt, __FILE__, __LINE__, ##args); \
    }                                                                                                 \
  } while (false)