From 66bd7af3e59e509000b8a55a9429e7a8e133fd81 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Tue, 14 Mar 2023 23:30:32 +0100 Subject: Sync with upstream 2.14.1 and update the documentation --- include/i3lock.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 include/i3lock.h (limited to 'include/i3lock.h') diff --git a/include/i3lock.h b/include/i3lock.h new file mode 100644 index 0000000..6cf7694 --- /dev/null +++ b/include/i3lock.h @@ -0,0 +1,15 @@ +#ifndef _I3LOCK_H +#define _I3LOCK_H + +/* This macro will only print debug output when started with --debug. + * This is important because xautolock (for example) closes stdout/stderr by + * default, so just printing something to stdout will lead to the data ending + * up on the X11 socket (!). */ +#define DEBUG(fmt, ...) \ + do { \ + if (debug_mode) { \ + fprintf(stderr, "[i3lock-extended-debug] " fmt, ##__VA_ARGS__); \ + } \ + } while (0) + +#endif -- cgit v1.3