Aaron Wisner | db51120 | 2018-06-26 15:38:35 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <inttypes.h> |
| 4 | #include <stdlib.h> |
| 5 | |
| 6 | #include <string> |
| 7 | |
| 8 | #include <bootimg.h> |
| 9 | |
| 10 | /* util stuff */ |
| 11 | double now(); |
Aaron Wisner | db51120 | 2018-06-26 15:38:35 -0500 | [diff] [blame] | 12 | void set_verbose(); |
| 13 | |
Aaron Wisner | db51120 | 2018-06-26 15:38:35 -0500 | [diff] [blame] | 14 | // These printf-like functions are implemented in terms of vsnprintf, so they |
| 15 | // use the same attribute for compile-time format string checking. |
| 16 | void die(const char* fmt, ...) __attribute__((__noreturn__)) |
| 17 | __attribute__((__format__(__printf__, 1, 2))); |
David Anderson | 7c84b9f | 2019-06-27 22:15:29 -0700 | [diff] [blame] | 18 | |
Aaron Wisner | db51120 | 2018-06-26 15:38:35 -0500 | [diff] [blame] | 19 | void verbose(const char* fmt, ...) __attribute__((__format__(__printf__, 1, 2))); |
David Anderson | 7c84b9f | 2019-06-27 22:15:29 -0700 | [diff] [blame] | 20 | |
| 21 | void die(const std::string& str) __attribute__((__noreturn__)); |