brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | #ifndef AOS_COMMON_DIE_H_ |
| 2 | #define AOS_COMMON_DIE_H_ |
| 3 | |
| 4 | #include <stdarg.h> |
| 5 | |
| 6 | namespace aos { |
| 7 | |
| 8 | // Terminates the task/process and logs a message (without using the logging |
| 9 | // framework). Designed for use in code that can't use the logging framework |
| 10 | // (code that can should LOG(FATAL), which calls this). |
| 11 | void Die(const char *format, ...) |
| 12 | __attribute__((noreturn)) |
| 13 | __attribute__((format(gnu_printf, 1, 2))); |
| 14 | void VDie(const char *format, va_list args) |
| 15 | __attribute__((noreturn)) |
| 16 | __attribute__((format(gnu_printf, 1, 0))); |
| 17 | |
| 18 | } // namespace aos |
| 19 | |
| 20 | #endif // AOS_COMMON_DIE_H_ |