Skip to content

Commit 3a815c7

Browse files
committed
Update '*dump' macros to require semicolons
1 parent 4d4a1f8 commit 3a815c7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/fc/log/logger.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -165,27 +165,27 @@ namespace fc
165165
// However, to log as much info as possible, it's better to catch exceptions when processing each argument
166166
#define idump( SEQ ) \
167167
{ \
168-
try { \
168+
do { try { \
169169
ilog( FC_FORMAT(SEQ), FC_FORMAT_ARG_PARAMS(SEQ) ); \
170170
} catch( ... ) { \
171171
ilog ( "[ERROR: Got exception while trying to dump ( ${args} )]",("args",FC_DUMP_FORMAT_ARG_NAMES(SEQ)) ); \
172-
} \
172+
} while( false ) \
173173
}
174174
#define wdump( SEQ ) \
175175
{ \
176-
try { \
176+
do { try { \
177177
wlog( FC_FORMAT(SEQ), FC_FORMAT_ARG_PARAMS(SEQ) ); \
178178
} catch( ... ) { \
179179
wlog ( "[ERROR: Got exception while trying to dump ( ${args} )]",("args",FC_DUMP_FORMAT_ARG_NAMES(SEQ)) ); \
180-
} \
180+
} while( false ) \
181181
}
182182
#define edump( SEQ ) \
183183
{ \
184-
try { \
184+
do { try { \
185185
elog( FC_FORMAT(SEQ), FC_FORMAT_ARG_PARAMS(SEQ) ); \
186186
} catch( ... ) { \
187187
elog ( "[ERROR: Got exception while trying to dump ( ${args} )]",("args",FC_DUMP_FORMAT_ARG_NAMES(SEQ)) ); \
188-
} \
188+
} while( false ) \
189189
}
190190

191191
// this disables all normal logging statements -- not something you'd normally want to do,

0 commit comments

Comments
 (0)