2015-08-08 21:01:22 +00:00
|
|
|
#ifndef _SWAY_LOG_H
|
|
|
|
#define _SWAY_LOG_H
|
2015-08-18 21:38:34 +00:00
|
|
|
#include <stdbool.h>
|
2018-01-05 21:32:51 +00:00
|
|
|
#include <wlr/util/log.h>
|
2017-04-20 16:13:53 +00:00
|
|
|
|
2018-07-09 21:54:30 +00:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#define ATTRIB_PRINTF(start, end) __attribute__((format(printf, start, end)))
|
|
|
|
#else
|
|
|
|
#define ATTRIB_PRINTF(start, end)
|
|
|
|
#endif
|
|
|
|
|
2018-01-05 22:36:32 +00:00
|
|
|
void _sway_abort(const char *filename, ...) ATTRIB_PRINTF(1, 2);
|
2017-04-20 16:13:53 +00:00
|
|
|
#define sway_abort(FMT, ...) \
|
2018-07-09 21:54:30 +00:00
|
|
|
_sway_abort("[%s:%d] " FMT, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__)
|
2015-08-26 18:01:26 +00:00
|
|
|
|
2018-01-05 22:36:32 +00:00
|
|
|
bool _sway_assert(bool condition, const char* format, ...) ATTRIB_PRINTF(2, 3);
|
2015-08-26 18:01:26 +00:00
|
|
|
#define sway_assert(COND, FMT, ...) \
|
2018-07-09 21:54:30 +00:00
|
|
|
_sway_assert(COND, "[%s:%d] %s:" FMT, _wlr_strip_path(__FILE__), __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__)
|
2015-08-26 18:01:26 +00:00
|
|
|
|
2015-08-24 20:44:58 +00:00
|
|
|
void error_handler(int sig);
|
2015-08-08 21:01:22 +00:00
|
|
|
|
|
|
|
#endif
|