diff --git a/inc/logs_out.h b/inc/logs_out.h index a9f8aeb..5380cfa 100644 --- a/inc/logs_out.h +++ b/inc/logs_out.h @@ -63,42 +63,42 @@ void timestamp(char * timestr, int maxsize); #else // Stdout usage -#define PRINT_MSG(fmt, args...) { \ +#define PRINT_MSG(fmt, args...) do { \ char timestr[32]; \ timestamp((char*)×tr, sizeof(timestr)); \ fprintf(stdout, \ "[uMTPrd - %s - Info] " fmt "\n",(char*)×tr, \ ## args); \ fflush(stdout); \ - } + } while (0) -#define PRINT_ERROR(fmt, args...) { \ +#define PRINT_ERROR(fmt, args...) do { \ char timestr[32]; \ timestamp((char*)×tr, sizeof(timestr)); \ fprintf(stderr, \ "[uMTPrd - %s - Error] " fmt "\n",(char*)×tr, \ ## args); \ fflush(stderr); \ - } + } while (0) -#define PRINT_WARN(fmt, args...) { \ +#define PRINT_WARN(fmt, args...) do { \ char timestr[32]; \ timestamp((char*)×tr, sizeof(timestr)); \ fprintf(stdout, \ "[uMTPrd - %s - Warning] " fmt "\n",(char*)×tr, \ ## args); \ fflush(stdout); \ - } + } while (0) #ifdef DEBUG -#define PRINT_DEBUG(fmt, args...) { \ +#define PRINT_DEBUG(fmt, args...) do { \ char timestr[32]; \ timestamp((char*)×tr, sizeof(timestr)); \ fprintf(stdout, \ "[uMTPrd - %s - Debug] " fmt "\n",(char*)×tr, \ ## args); \ fflush(stdout); \ - } + } while (0) #else #define PRINT_DEBUG(fmt, args...)