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

Commit 4075ec0b authored by Myles Watson's avatar Myles Watson Committed by android-build-merger
Browse files

Merge "OS: Use LOG_ALWAYS_FATAL for Android" am: cf34fd95

am: 8b6d8a2a

Change-Id: I9cb7068f9e2a61c1a294659a993ccd479bd24f12
parents a5fe90c8 8b6d8a2a
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)