]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: fix data stack marker generation
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Tue, 15 Nov 2016 14:06:10 +0000 (09:06 -0500)
committerGitLab <gitlab@git.dovecot.net>
Tue, 15 Nov 2016 20:34:01 +0000 (22:34 +0200)
The line number wasn't getting expanded.

src/lib/data-stack.h

index 7725489c3e9ebf294ef7d58025113f73966a41f2..6570565d78d5fe302e803a3b1a6734741152561e 100644 (file)
@@ -58,10 +58,11 @@ bool t_pop(data_stack_frame_t *id) ATTR_HOT;
 void t_pop_last_unsafe(void);
 
 /* Usage: T_BEGIN { code } T_END */
-#define T_CAT2(a,b) (a ":" #b)
+#define T_STRING(x)    #x
+#define T_XSTRING(x)   T_STRING(x)     /* expand and then stringify */
 #define T_BEGIN \
        STMT_START { \
-               data_stack_frame_t _data_stack_cur_id = t_push(T_CAT2(__FILE__, __LINE__));
+               data_stack_frame_t _data_stack_cur_id = t_push(__FILE__ ":" T_XSTRING(__LINE__));
 #define T_END \
        STMT_START { \
                if (unlikely(!t_pop(&_data_stack_cur_id))) \