From: Michael Stapelberg Date: Sun, 12 Aug 2012 10:18:43 +0000 (+0200) Subject: use I3__FILE__ for DLOG, leave __FILE__ as is X-Git-Tag: 4.3~109 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=884627ef20dfb2edae9a5c99bb470bfbf0301904;p=i3%2Fi3 use I3__FILE__ for DLOG, leave __FILE__ as is See also commit 0e752070ac2bed02d0858bbc450ddcee36e3b9b5, which broke source code listings in gdb unless you cd into i3/src. This should give us best of both :-). --- diff --git a/common.mk b/common.mk index 0d2ad51e..a6d6c4e3 100644 --- a/common.mk +++ b/common.mk @@ -56,6 +56,7 @@ I3_CPPFLAGS += -DMAJOR_VERSION=${MAJOR_VERSION} I3_CPPFLAGS += -DMINOR_VERSION=${MINOR_VERSION} I3_CPPFLAGS += -DPATCH_VERSION=${PATCH_VERSION} I3_CPPFLAGS += -DSYSCONFDIR=\"${SYSCONFDIR}\" +I3_CPPFLAGS += -DI3__FILE__=__FILE__ ## Libraries flags diff --git a/include/log.h b/include/log.h index a8209cca..0854628d 100644 --- a/include/log.h +++ b/include/log.h @@ -17,7 +17,7 @@ is, delete the preceding comma */ #define LOG(fmt, ...) verboselog(fmt, ##__VA_ARGS__) #define ELOG(fmt, ...) errorlog("ERROR: " fmt, ##__VA_ARGS__) -#define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, I3__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) extern char *errorfilename; extern char *shmlogname; diff --git a/src/assignments.c b/src/assignments.c index 696eca49..655816a3 100644 --- a/src/assignments.c +++ b/src/assignments.c @@ -1,4 +1,5 @@ -#line 2 "assignments.c" +#undef I3__FILE__ +#define I3__FILE__ "assignments.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/click.c b/src/click.c index 52a7d3b5..23b6be4f 100644 --- a/src/click.c +++ b/src/click.c @@ -1,4 +1,5 @@ -#line 2 "click.c" +#undef I3__FILE__ +#define I3__FILE__ "click.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/commands.c b/src/commands.c index 6d508af9..02d602f0 100644 --- a/src/commands.c +++ b/src/commands.c @@ -1,4 +1,5 @@ -#line 2 "commands.c" +#undef I3__FILE__ +#define I3__FILE__ "commands.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/commands_parser.c b/src/commands_parser.c index 71f1c149..20a7d67a 100644 --- a/src/commands_parser.c +++ b/src/commands_parser.c @@ -1,4 +1,5 @@ -#line 2 "commands_parser.c" +#undef I3__FILE__ +#define I3__FILE__ "commands_parser.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/con.c b/src/con.c index 8f51df31..0c82163a 100644 --- a/src/con.c +++ b/src/con.c @@ -1,4 +1,5 @@ -#line 2 "con.c" +#undef I3__FILE__ +#define I3__FILE__ "con.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/config.c b/src/config.c index 4757db20..c256a3b7 100644 --- a/src/config.c +++ b/src/config.c @@ -1,4 +1,5 @@ -#line 2 "config.c" +#undef I3__FILE__ +#define I3__FILE__ "config.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/debug.c b/src/debug.c index 4841840f..2dcdb56a 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1,4 +1,5 @@ -#line 2 "debug.c" +#undef I3__FILE__ +#define I3__FILE__ "debug.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/ewmh.c b/src/ewmh.c index afc4eb90..45d4e5fe 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -1,4 +1,5 @@ -#line 2 "ewmh.c" +#undef I3__FILE__ +#define I3__FILE__ "ewmh.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/fake_outputs.c b/src/fake_outputs.c index 7c957225..e1153299 100644 --- a/src/fake_outputs.c +++ b/src/fake_outputs.c @@ -1,4 +1,5 @@ -#line 2 "fake_outputs.c" +#undef I3__FILE__ +#define I3__FILE__ "fake_outputs.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/floating.c b/src/floating.c index 69241b58..3d2c1d31 100644 --- a/src/floating.c +++ b/src/floating.c @@ -1,4 +1,5 @@ -#line 2 "floating.c" +#undef I3__FILE__ +#define I3__FILE__ "floating.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/handlers.c b/src/handlers.c index 3a8d2344..a69a6269 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -1,4 +1,5 @@ -#line 2 "handlers.c" +#undef I3__FILE__ +#define I3__FILE__ "handlers.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/ipc.c b/src/ipc.c index 967e8871..8db69259 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -1,4 +1,5 @@ -#line 2 "ipc.c" +#undef I3__FILE__ +#define I3__FILE__ "ipc.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/key_press.c b/src/key_press.c index e8fbe17c..2a578d66 100644 --- a/src/key_press.c +++ b/src/key_press.c @@ -1,4 +1,5 @@ -#line 2 "key_press.c" +#undef I3__FILE__ +#define I3__FILE__ "key_press.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/load_layout.c b/src/load_layout.c index 2f2d5a64..795fb6d8 100644 --- a/src/load_layout.c +++ b/src/load_layout.c @@ -1,4 +1,5 @@ -#line 2 "load_layout.c" +#undef I3__FILE__ +#define I3__FILE__ "load_layout.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/log.c b/src/log.c index 944edb3f..ab75395f 100644 --- a/src/log.c +++ b/src/log.c @@ -1,4 +1,5 @@ -#line 2 "log.c" +#undef I3__FILE__ +#define I3__FILE__ "log.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/main.c b/src/main.c index d6a7f617..b60bb6d7 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,5 @@ -#line 2 "main.c" +#undef I3__FILE__ +#define I3__FILE__ "main.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/manage.c b/src/manage.c index 2d08afaa..1dc39b9e 100644 --- a/src/manage.c +++ b/src/manage.c @@ -1,4 +1,5 @@ -#line 2 "manage.c" +#undef I3__FILE__ +#define I3__FILE__ "manage.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/match.c b/src/match.c index 08ec0310..1014de84 100644 --- a/src/match.c +++ b/src/match.c @@ -1,4 +1,5 @@ -#line 2 "match.c" +#undef I3__FILE__ +#define I3__FILE__ "match.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/move.c b/src/move.c index a4fc77b3..46b90177 100644 --- a/src/move.c +++ b/src/move.c @@ -1,4 +1,5 @@ -#line 2 "move.c" +#undef I3__FILE__ +#define I3__FILE__ "move.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/output.c b/src/output.c index dc676ba4..fe8d4983 100644 --- a/src/output.c +++ b/src/output.c @@ -1,4 +1,5 @@ -#line 2 "output.c" +#undef I3__FILE__ +#define I3__FILE__ "output.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/randr.c b/src/randr.c index e1175473..6971ba97 100644 --- a/src/randr.c +++ b/src/randr.c @@ -1,4 +1,5 @@ -#line 2 "randr.c" +#undef I3__FILE__ +#define I3__FILE__ "randr.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/regex.c b/src/regex.c index 93e1af2d..60dee5cc 100644 --- a/src/regex.c +++ b/src/regex.c @@ -1,4 +1,5 @@ -#line 2 "regex.c" +#undef I3__FILE__ +#define I3__FILE__ "regex.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/render.c b/src/render.c index f933433f..9c0debb3 100644 --- a/src/render.c +++ b/src/render.c @@ -1,4 +1,5 @@ -#line 2 "render.c" +#undef I3__FILE__ +#define I3__FILE__ "render.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/resize.c b/src/resize.c index b0c7a052..b65344a2 100644 --- a/src/resize.c +++ b/src/resize.c @@ -1,4 +1,5 @@ -#line 2 "resize.c" +#undef I3__FILE__ +#define I3__FILE__ "resize.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/scratchpad.c b/src/scratchpad.c index da50cee7..6bba823f 100644 --- a/src/scratchpad.c +++ b/src/scratchpad.c @@ -1,4 +1,5 @@ -#line 2 "scratchpad.c" +#undef I3__FILE__ +#define I3__FILE__ "scratchpad.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/sighandler.c b/src/sighandler.c index a218b021..bae73c16 100644 --- a/src/sighandler.c +++ b/src/sighandler.c @@ -1,4 +1,5 @@ -#line 2 "sighandler.c" +#undef I3__FILE__ +#define I3__FILE__ "sighandler.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/startup.c b/src/startup.c index b462a853..b0aa2ca3 100644 --- a/src/startup.c +++ b/src/startup.c @@ -1,4 +1,5 @@ -#line 2 "startup.c" +#undef I3__FILE__ +#define I3__FILE__ "startup.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/tree.c b/src/tree.c index cee61b9d..d2dc10ea 100644 --- a/src/tree.c +++ b/src/tree.c @@ -1,4 +1,5 @@ -#line 2 "tree.c" +#undef I3__FILE__ +#define I3__FILE__ "tree.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/util.c b/src/util.c index 45e63e1c..db2f0204 100644 --- a/src/util.c +++ b/src/util.c @@ -1,4 +1,5 @@ -#line 2 "util.c" +#undef I3__FILE__ +#define I3__FILE__ "util.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/window.c b/src/window.c index 15f722e2..6ec63a8b 100644 --- a/src/window.c +++ b/src/window.c @@ -1,4 +1,5 @@ -#line 2 "window.c" +#undef I3__FILE__ +#define I3__FILE__ "window.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/workspace.c b/src/workspace.c index 8e834dbd..85331181 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -1,4 +1,5 @@ -#line 2 "workspace.c" +#undef I3__FILE__ +#define I3__FILE__ "workspace.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/x.c b/src/x.c index 661dece6..65b3eb1f 100644 --- a/src/x.c +++ b/src/x.c @@ -1,4 +1,5 @@ -#line 2 "x.c" +#undef I3__FILE__ +#define I3__FILE__ "x.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/xcb.c b/src/xcb.c index 3d2ff670..be3f536a 100644 --- a/src/xcb.c +++ b/src/xcb.c @@ -1,4 +1,5 @@ -#line 2 "xcb.c" +#undef I3__FILE__ +#define I3__FILE__ "xcb.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/xcursor.c b/src/xcursor.c index 48f713a7..7683b0d3 100644 --- a/src/xcursor.c +++ b/src/xcursor.c @@ -1,4 +1,5 @@ -#line 2 "xcursor.c" +#undef I3__FILE__ +#define I3__FILE__ "xcursor.c" /* * vim:ts=4:sw=4:expandtab * diff --git a/src/xinerama.c b/src/xinerama.c index 5c0504ca..7e5b5aeb 100644 --- a/src/xinerama.c +++ b/src/xinerama.c @@ -1,4 +1,5 @@ -#line 2 "xinerama.c" +#undef I3__FILE__ +#define I3__FILE__ "xinerama.c" /* * vim:ts=4:sw=4:expandtab *