From 912af050a660ff7d21a126544b6b6a57a16b6aee Mon Sep 17 00:00:00 2001 From: Ahmed Irfan Date: Tue, 3 Oct 2023 20:00:48 -0700 Subject: [PATCH 1/2] fix mingw strerror_r issue --- src/utils/error.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils/error.c b/src/utils/error.c index fee3577e1..55df07ad6 100644 --- a/src/utils/error.c +++ b/src/utils/error.c @@ -30,7 +30,12 @@ void perror_fatal(const char *s) { void perror_fatal_code(const char *s, int err) { char buffer[64]; +#ifdef MINGW + fprintf(stderr, "%s: %s\n", s, strerror(err)); + exit(YICES_EXIT_INTERNAL_ERROR); +#else strerror_r(err, buffer, sizeof(buffer)); fprintf(stderr, "%s: %s\n", s, buffer); exit(YICES_EXIT_INTERNAL_ERROR); +#endif } From 0401d9fea9ccd150b337656c60544f2e7c785b08 Mon Sep 17 00:00:00 2001 From: Ahmed Irfan Date: Tue, 3 Oct 2023 20:06:31 -0700 Subject: [PATCH 2/2] minor --- src/utils/error.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/error.c b/src/utils/error.c index 55df07ad6..ceb0b0cdf 100644 --- a/src/utils/error.c +++ b/src/utils/error.c @@ -32,10 +32,10 @@ void perror_fatal_code(const char *s, int err) { #ifdef MINGW fprintf(stderr, "%s: %s\n", s, strerror(err)); - exit(YICES_EXIT_INTERNAL_ERROR); #else strerror_r(err, buffer, sizeof(buffer)); fprintf(stderr, "%s: %s\n", s, buffer); - exit(YICES_EXIT_INTERNAL_ERROR); #endif + + exit(YICES_EXIT_INTERNAL_ERROR); }