Logging: Fix broken logging macros.

This is macro 101, you don't EVER put multiple statements in a macro
like that.
See Chris's commits, these broken macros already introduced (subtle)
bugs. Always surround macros in "do {} while()" unless you absolutely
can't (like when you declare a new variable to be used in the scope).

Why is it even there? I think we can safely assume eina log is available
for usage in E...

@fix
This commit is contained in:
Tom Hacohen 2015-06-22 15:37:13 +01:00
parent b1b407ef22
commit ba82d22692
1 changed files with 5 additions and 5 deletions

View File

@ -27,11 +27,11 @@ EINTERN int e_log_shutdown(void);
#undef WRN #undef WRN
#undef ERR #undef ERR
#undef CRI #undef CRI
#define DBG(...) printf(__VA_ARGS__); putc('\n', stdout) #define DBG(...) do { printf(__VA_ARGS__); putc('\n', stdout); } while(0)
#define INF(...) printf(__VA_ARGS__); putc('\n', stdout) #define INF(...) do { printf(__VA_ARGS__); putc('\n', stdout); } while(0)
#define WRN(...) printf(__VA_ARGS__); putc('\n', stdout) #define WRN(...) do { printf(__VA_ARGS__); putc('\n', stdout); } while(0)
#define ERR(...) printf(__VA_ARGS__); putc('\n', stdout) #define ERR(...) do { printf(__VA_ARGS__); putc('\n', stdout); } while(0)
#define CRI(...) printf(__VA_ARGS__); putc('\n', stdout) #define CRI(...) do { printf(__VA_ARGS__); putc('\n', stdout); } while(0)
#endif #endif
#endif #endif