Mercurial > dillo_port1.3
changeset 1146:053eb660faaf
Refactor of MSG macros
author | Jorge Arellano Cid <jcid@dillo.org> |
---|---|
date | Fri, 29 May 2009 16:23:03 -0400 |
parents | 9b57a492918b |
children | e048ab285d1e d76ff9ca5658 |
files | src/msg.h |
diffstat | 1 files changed, 6 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/src/msg.h Fri May 29 16:17:06 2009 -0400 +++ b/src/msg.h Fri May 29 16:23:03 2009 -0400 @@ -11,28 +11,17 @@ #define _MSG_WARN(...) #define _MSG_HTTP(...) - -#define MSG(...) \ +#define MSG_INNARDS(prefix, ...) \ D_STMT_START { \ if (prefs.show_msg){ \ - printf(__VA_ARGS__); \ + printf(prefix __VA_ARGS__); \ fflush (stdout); \ } \ } D_STMT_END -#define MSG_WARN(...) \ - D_STMT_START { \ - if (prefs.show_msg) \ - printf("** WARNING **: " __VA_ARGS__); \ - } D_STMT_END - -#define MSG_ERR(...) \ - D_STMT_START { \ - if (prefs.show_msg) \ - printf("** ERROR **: " __VA_ARGS__); \ - } D_STMT_END - -#define MSG_HTTP(...) \ - printf("HTTP warning: " __VA_ARGS__) +#define MSG(...) MSG_INNARDS("", __VA_ARGS__) +#define MSG_WARN(...) MSG_INNARDS("** WARNING **: ", __VA_ARGS__) +#define MSG_ERR(...) MSG_INNARDS("** ERROR **: ", __VA_ARGS__) +#define MSG_HTTP(...) MSG_INNARDS("HTTP warning: ", __VA_ARGS__) #endif /* __MSG_H__ */