Skip to content

Commit 2a879bc

Browse files
committed
Merge pull request #150 from librehat/master
add fflush stderr on Windows.
2 parents a578c35 + 5bf9f7e commit 2a879bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,17 @@ extern FILE * logfile;
9898
time_t now = time(NULL); \
9999
char timestr[20]; \
100100
strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \
101-
fprintf(stderr, " %s INFO: " format "\n", timestr, ## __VA_ARGS__); } \
101+
fprintf(stderr, " %s INFO: " format "\n", timestr, ## __VA_ARGS__); \
102+
fflush(stderr); } \
102103
while (0)
103104

104105
#define LOGE(format, ...) \
105106
do { \
106107
time_t now = time(NULL); \
107108
char timestr[20]; \
108109
strftime(timestr, 20, TIME_FORMAT, localtime(&now)); \
109-
fprintf(stderr, " %s ERROR: " format "\n", timestr, ## __VA_ARGS__); } \
110+
fprintf(stderr, " %s ERROR: " format "\n", timestr, ## __VA_ARGS__); \
111+
fflush(stderr); } \
110112
while (0)
111113

112114
#else

0 commit comments

Comments
 (0)