mirror of
https://git.disroot.org/80486DX2-66/polonium.git
synced 2024-11-08 13:42:31 +05:30
common.h: remove commented code and add a note
This commit is contained in:
parent
743bffc9d2
commit
0833f7a4d2
@ -29,33 +29,9 @@ enum configurations {
|
||||
fflush(stdout); \
|
||||
fprintf(stream, __VA_ARGS__); \
|
||||
} while (0)
|
||||
/* // Intel A80486DX2-66: doesn't compile on my system
|
||||
// TODO: remove this multi-line comment before merging into main branch
|
||||
#define PERROR_MACRO(s) do { \
|
||||
fflush(stdout); \
|
||||
int errnum = errno; \
|
||||
size_t err_msg_size = 256; \
|
||||
char *err_msg = NULL; \
|
||||
int ret = -1; \
|
||||
do { \
|
||||
err_msg_size *= 2; \
|
||||
char* new_err_msg = realloc(err_msg, err_msg_size); \
|
||||
if (new_err_msg == NULL) { \
|
||||
free(err_msg); \
|
||||
break; \
|
||||
} \
|
||||
err_msg = new_err_msg; \
|
||||
ret = strerror_r(errnum, err_msg, err_msg_size); \
|
||||
} while (ret == -1 && errno == ERANGE); \
|
||||
if (ret == 0) { \
|
||||
fprintf(stderr, "%s:%d: %s: %s\n", __FILE__, __LINE__, (s), err_msg); \
|
||||
} \
|
||||
free(err_msg); \
|
||||
} while (0)
|
||||
*/
|
||||
#define PERROR_MACRO(s) do { \
|
||||
int errnum = errno; \
|
||||
char* err_msg = strerror(errnum); \
|
||||
char* err_msg = strerror(errnum); /* XXX: Thread race possible */ \
|
||||
fflush(stdout); \
|
||||
fprintf(stderr, "%s:%d: %s: %s\n", __FILE__, __LINE__, (s), err_msg); \
|
||||
} while (0)
|
||||
|
Loading…
Reference in New Issue
Block a user