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
devs/stefan/wl-session-recovery
Tom Hacohen 7 years ago
parent b1b407ef22
commit ba82d22692
  1. 10
      src/bin/e_log.h

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

Loading…
Cancel
Save