openbsd-ports/x11/i3/patches/patch-include_libi3_h
2014-01-11 16:04:43 +00:00

37 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$OpenBSD: patch-include_libi3_h,v 1.1 2014/01/11 16:04:43 dcoppa Exp $
commit 0883dfbe14628430caaeefdb00e282a008d30d76
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue Dec 24 10:35:56 2013 +0100
only LOG() the DPI when it changes, DLOG() it otherwise
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it's actually
relevant (upon DPI changes).
--- include/libi3.h.orig Sun Dec 22 21:12:41 2013
+++ include/libi3.h Fri Jan 10 21:41:56 2014
@@ -72,12 +72,19 @@ struct Font {
/* Since this file also gets included by utilities which dont use the i3 log
* infrastructure, we define a fallback. */
#if !defined(LOG)
-void verboselog(char *fmt, ...);
+void verboselog(char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
#define LOG(fmt, ...) verboselog("[libi3] " __FILE__ " " fmt, ##__VA_ARGS__)
#endif
#if !defined(ELOG)
-void errorlog(char *fmt, ...);
+void errorlog(char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
#define ELOG(fmt, ...) errorlog("[libi3] ERROR: " fmt, ##__VA_ARGS__)
+#endif
+#if !defined(DLOG)
+void debuglog(char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
+#define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, I3__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
#endif
/**