From 0833f7a4d24c0b9fafe4e50468d4c7f167338e71 Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Thu, 11 Jul 2024 20:29:34 +0300 Subject: [PATCH] common.h: remove commented code and add a note --- include/common.h | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/include/common.h b/include/common.h index a5a0fde..065ab4b 100644 --- a/include/common.h +++ b/include/common.h @@ -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)