From cc9d1cacbb79ce9a54f2c8505a25f4ace7d74c46 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Mon, 2 May 2016 15:10:22 +0100 Subject: common: refactor sway_log() This removes most preprocessor logic, leaving it only it the header. --- include/log.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/log.h') diff --git a/include/log.h b/include/log.h index 268783f4..efacf90f 100644 --- a/include/log.h +++ b/include/log.h @@ -22,14 +22,14 @@ bool _sway_assert(bool condition, const char* format, ...) __attribute__((format #define sway_assert(COND, FMT, ...) \ _sway_assert(COND, "%s:" FMT, __PRETTY_FUNCTION__, ##__VA_ARGS__) -#ifndef NDEBUG void _sway_log(const char *filename, int line, log_importance_t verbosity, const char* format, ...) __attribute__((format(printf,4,5))); + +#ifndef NDEBUG #define sway_log(VERBOSITY, FMT, ...) \ _sway_log(__FILE__, __LINE__, VERBOSITY, FMT, ##__VA_ARGS__) #else -void _sway_log(log_importance_t verbosity, const char* format, ...) __attribute__((format(printf,2,3))); #define sway_log(VERBOSITY, FMT, ...) \ - _sway_log(VERBOSITY, FMT, ##__VA_ARGS__) + _sway_log(NULL, 0, VERBOSITY, FMT, ##__VA_ARGS__) #endif void error_handler(int sig); -- cgit v1.2.3-54-g00ecf