Hello,

This is yesterday's patch with a few test changes:

- test t_assert no longer calls `_setmode` to enable Unicode translation mode 
on stderr
- new test t_wassert; it is similar to t_assert, except it tests `_wassert` and 
conditionally enables Unicode translation mode on stderr
- both t_assert and t_wassert write child process' assertion message to stdout 
(this is a change from my June patches which was not pushed)

I just pushed them for CI run: 
https://github.com/maiddaisuki/mingw-w64/actions/runs/34968566011; as I write 
this I see that "gcc" jobs failed due to download issues. I'll rerun those when 
run is over; I do not expect any real issues with these changes.

- Kirill Makurin
From b465b7adfe4e7825bb6fc8877d86e34b324fa0ba Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Tue, 15 Sep 2026 21:21:53 +0900
Subject: [PATCH 1/4] crt: tests: t_assert: do not set `stderr` to Unicode
 translation mode

By default, `assert` macro calls CRT function `_assert`; this function
does not work when `stderr` is set to Unicode translation mode.

This test was added in b2c3c92b542df57ed8bfcd798928692e94a35308 to
test mingw-w64 wrapper for `_assert`, which was added to make it work
in cases when `stderr` wsa set to Unicode translation mode.

With this change, t_assert becomes a simple test for `assert` macro.

Signed-off-by: Kirill Makurin <[email protected]>
---
 mingw-w64-crt/testcases/t_assert.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mingw-w64-crt/testcases/t_assert.c 
b/mingw-w64-crt/testcases/t_assert.c
index 7e74ea70e..4112f48de 100644
--- a/mingw-w64-crt/testcases/t_assert.c
+++ b/mingw-w64-crt/testcases/t_assert.c
@@ -47,9 +47,6 @@ int main(int argc, char *argv[]) {
         return 0;
     }
 
-    /* change stderr to translated UNICODE mode */
-    _setmode(fileno(stderr), _O_U8TEXT);
-
     /* call assert, it prints to stderr, parent process will check that our 
stderr is not empty */
     assert(0);
 
-- 
2.55.0.windows.3

From 806441369d41a8834dde3586d3d3fa202115b6d6 Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Tue, 15 Sep 2026 21:21:53 +0900
Subject: [PATCH 2/4] crt: tests: t_assert: write child process' output to
 stdout

After the child process terminates, read the rest of the data it has written
to the pipe and write it to stdout; this allows to examine assertion message
printed by the child process.

Signed-off-by: Kirill Makurin <[email protected]>
---
 mingw-w64-crt/testcases/t_assert.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/mingw-w64-crt/testcases/t_assert.c 
b/mingw-w64-crt/testcases/t_assert.c
index 4112f48de..f3cec22e3 100644
--- a/mingw-w64-crt/testcases/t_assert.c
+++ b/mingw-w64-crt/testcases/t_assert.c
@@ -36,7 +36,6 @@ int main(int argc, char *argv[]) {
         assert(process != -1);
 
         size = read(pipefd[0], buf, sizeof(buf));
-        close(pipefd[0]);
         assert(size > 0); /* some data were written by child process */
         assert(strnlen(buf, sizeof(buf)) > 0);
 
@@ -44,6 +43,13 @@ int main(int argc, char *argv[]) {
         assert(_cwait(&exit_code, process, _WAIT_CHILD) == process);
         assert(exit_code != 0);
 
+        /* read the rest of data in the pipe and write it to stdout */
+        if (size < (ssize_t)sizeof(buf)) {
+            size += read(pipefd[0], &buf[size], sizeof(buf) - size);
+        }
+        close(pipefd[0]);
+        write(STDOUT_FILENO, buf, size);
+
         return 0;
     }
 
-- 
2.55.0.windows.3

From 7dc26adf1155b3cf1cb5d0dc135d081fb7e6a9b5 Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Tue, 15 Sep 2026 21:21:53 +0900
Subject: [PATCH 3/4] crt: tests: add new test t_wassert

This test is similar to t_assert, except it tests CRT function `_wassert`.

Unlike `_assert`, CRT function `_wassert` properly behaves in case when
`stderr` was set to Unicode translation mode.

When this test is compiled with msvcrt.dll, or msvcr80.dll and later, it also
sets `stderr` to Unicode transaltion mode before triggering an `assert`.

Signed-off-by: Kirill Makurin <[email protected]>
---
 mingw-w64-crt/testcases/Makefile.am |  1 +
 mingw-w64-crt/testcases/t_wassert.c | 85 +++++++++++++++++++++++++++++
 2 files changed, 86 insertions(+)
 create mode 100644 mingw-w64-crt/testcases/t_wassert.c

diff --git a/mingw-w64-crt/testcases/Makefile.am 
b/mingw-w64-crt/testcases/Makefile.am
index b4cb67e63..6cfa3f883 100644
--- a/mingw-w64-crt/testcases/Makefile.am
+++ b/mingw-w64-crt/testcases/Makefile.am
@@ -187,6 +187,7 @@ testcase_progs = \
   t_tsearch \
   t_utime \
   t_vsscanf \
+  t_wassert \
   t_wcrtomb \
   t_wcsrtombs \
   t_wcstok_s \
diff --git a/mingw-w64-crt/testcases/t_wassert.c 
b/mingw-w64-crt/testcases/t_wassert.c
new file mode 100644
index 000000000..b76a77622
--- /dev/null
+++ b/mingw-w64-crt/testcases/t_wassert.c
@@ -0,0 +1,85 @@
+#define _UNICODE
+#include <assert.h>
+#include <fcntl.h>
+#include <io.h>
+#include <process.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* mingw-w64 headers */
+#include "libtest.h"
+
+/**
+ * On some Windows versions, crtdll.dll, msvcrt20.dll and msvcrt40.dll may be
+ * redirected to system msvcrt.dll.
+ *
+ * This may result in `_setmode` succeeding to set `stderr` to Unicode
+ * translation mode, while `_wassert` emulation still calls `_assert`.
+ *
+ * This would result in `assert` macro silently terminating the process without
+ * producing any output.
+ *
+ * CRT function `_wassert` is available since msvcr80.dll, and msvcrt.dll
+ * since Windows Vista. Only attempt to set `stderr` to Unicode translation
+ * mode with msvcrt.dll, or msvcr80.dll and later.
+ */
+#if __MSVCRT_VERSION__ == 0x0600 || __MSVCRT_VERSION__ >= 0x0800
+#define TEST_UNICODE_MODE
+#endif
+
+int main(int argc, char *argv[]) {
+    mingw_test_init ();
+
+    if (argc != 2 || strcmp(argv[1], "assert_test") != 0) {
+        int exit_code;
+        int pipefd[2];
+        int back_errfd;
+        intptr_t process;
+        ssize_t size;
+        char buf[512];
+
+        assert(_pipe(pipefd, 0, O_NOINHERIT) == 0);
+
+        /* set stderr fd to write side of pipe, will be used by _spawnl() */
+        assert((back_errfd = dup(STDERR_FILENO)) >= 0);
+        assert(dup2(pipefd[1], STDERR_FILENO) == 0);
+        assert(close(pipefd[1]) == 0);
+
+        process = _spawnl(_P_NOWAIT, _pgmptr, argv[0], "assert_test", NULL);
+
+        /* revert back stderr fd */
+        assert(dup2(back_errfd, STDERR_FILENO) == 0);
+        assert(close(back_errfd) == 0);
+
+        assert(process != -1);
+
+        size = read(pipefd[0], buf, sizeof(buf));
+        assert(size > 0); /* some data were written by child process */
+        assert(strnlen(buf, sizeof(buf)) > 0);
+
+        /* wait until child process exits */
+        assert(_cwait(&exit_code, process, _WAIT_CHILD) == process);
+        assert(exit_code != 0);
+
+        /* read the rest of data in the pipe and write it to stdout */
+        if (size < (ssize_t)sizeof(buf)) {
+            size += read(pipefd[0], &buf[size], sizeof(buf) - size);
+        }
+        close(pipefd[0]);
+        write(STDOUT_FILENO, buf, size);
+
+        return 0;
+    }
+
+#ifdef TEST_UNICODE_MODE
+    /* change stderr to translated UNICODE mode */
+    _setmode(_fileno(stderr), _O_U8TEXT);
+#endif
+
+    /* call assert, it prints to stderr, parent process will check that our 
stderr is not empty */
+    assert(0);
+
+    /* assert(0) does not return, this process pass when returns non-zero */
+    return 0;
+}
-- 
2.55.0.windows.3

From 5b453f77b18301fb960b141075a4a25f1ce723fc Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Tue, 15 Sep 2026 21:21:54 +0900
Subject: [PATCH 4/4] crt: remove mingw-w64 wrapper for _assert()

The purpose of `_assert` wrapper was to make `assert` usable when an Unicode
translation mode was enabled on stderr. At the time when this wrapper was added,
it was asumed that `_assert` does not return, when in fact it can.

It is important to keep in mind that after displaying the message, `_assert`
terminates the process by calling `abort`; it is possible to escape from `abort`
by setting signal handler for SIGABRT which calls `longjmp`.

If an application were to perform such escape, previous translation mode used on
stderr will not be restored and it will be left in `_O_TEXT` translation mode.

`_assert` is also called from mingw-w64 wrapper for `_wassert`, which allocates
memory using `malloc`; such escape from `_assert` would result in a memory leak.

To avoid issues descrived above, remove wrapper for `_assert`. Any application
that calls `_assert` directly must take its limitations into account.

This change effectively reverts b2c3c92b542df57ed8bfcd798928692e94a35308.

Signed-off-by: Kirill Makurin <[email protected]>
---
 mingw-w64-crt/Makefile.am                     |  1 -
 .../api-ms-win-crt-runtime-l1-1-0.def.in      |  2 +-
 mingw-w64-crt/lib-common/msvcr120_app.def.in  |  2 +-
 mingw-w64-crt/lib-common/msvcrt.def.in        |  2 +-
 .../lib-common/ucrtbase-common.def.in         |  2 +-
 mingw-w64-crt/lib32/crtdll.def.in             |  2 +-
 mingw-w64-crt/lib32/msvcr100.def.in           |  2 +-
 mingw-w64-crt/lib32/msvcr100d.def.in          |  2 +-
 mingw-w64-crt/lib32/msvcr110.def.in           |  2 +-
 mingw-w64-crt/lib32/msvcr110d.def.in          |  2 +-
 mingw-w64-crt/lib32/msvcr120.def.in           |  2 +-
 mingw-w64-crt/lib32/msvcr120d.def.in          |  2 +-
 mingw-w64-crt/lib32/msvcr40d.def.in           |  2 +-
 mingw-w64-crt/lib32/msvcr70.def.in            |  2 +-
 mingw-w64-crt/lib32/msvcr70d.def.in           |  2 +-
 mingw-w64-crt/lib32/msvcr71.def.in            |  2 +-
 mingw-w64-crt/lib32/msvcr71d.def.in           |  2 +-
 mingw-w64-crt/lib32/msvcr80.def.in            |  2 +-
 mingw-w64-crt/lib32/msvcr80d.def.in           |  2 +-
 mingw-w64-crt/lib32/msvcr90.def.in            |  2 +-
 mingw-w64-crt/lib32/msvcr90d.def.in           |  2 +-
 mingw-w64-crt/lib32/msvcrt10.def.in           |  2 +-
 mingw-w64-crt/lib32/msvcrt20.def.in           |  2 +-
 mingw-w64-crt/lib32/msvcrt40.def.in           |  2 +-
 mingw-w64-crt/lib32/msvcrtd.def.in            |  2 +-
 mingw-w64-crt/lib64/msvcr100.def.in           |  2 +-
 mingw-w64-crt/lib64/msvcr100d.def.in          |  2 +-
 mingw-w64-crt/lib64/msvcr110.def.in           |  2 +-
 mingw-w64-crt/lib64/msvcr110d.def.in          |  2 +-
 mingw-w64-crt/lib64/msvcr120.def.in           |  2 +-
 mingw-w64-crt/lib64/msvcr120d.def.in          |  2 +-
 mingw-w64-crt/lib64/msvcr80.def.in            |  2 +-
 mingw-w64-crt/lib64/msvcr80d.def.in           |  2 +-
 mingw-w64-crt/lib64/msvcr90.def.in            |  2 +-
 mingw-w64-crt/lib64/msvcr90d.def.in           |  2 +-
 mingw-w64-crt/libarm32/msvcr110.def.in        |  2 +-
 mingw-w64-crt/libarm32/msvcr110d.def.in       |  2 +-
 mingw-w64-crt/libarm32/msvcr120.def.in        |  2 +-
 mingw-w64-crt/libarm32/msvcr120d.def.in       |  2 +-
 mingw-w64-crt/misc/_assert.c                  | 46 -------------------
 mingw-w64-headers/crt/assert.h                |  2 +-
 41 files changed, 39 insertions(+), 86 deletions(-)
 delete mode 100644 mingw-w64-crt/misc/_assert.c

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 85ba32940..61c2b3d18 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -1273,7 +1273,6 @@ src_libmingwex=\
   math/powi.def.h       math/sqrt.def.h    \
   math/cephes_mconf.h   math/fp_consts.h   math/pi_const.h \
   \
-  misc/_assert.c \
   misc/mingw_longjmp.S \
   misc/mingw_getsp.S \
   misc/alarm.c \
diff --git a/mingw-w64-crt/lib-common/api-ms-win-crt-runtime-l1-1-0.def.in 
b/mingw-w64-crt/lib-common/api-ms-win-crt-runtime-l1-1-0.def.in
index ef0aa03ba..79a7ac15c 100644
--- a/mingw-w64-crt/lib-common/api-ms-win-crt-runtime-l1-1-0.def.in
+++ b/mingw-w64-crt/lib-common/api-ms-win-crt-runtime-l1-1-0.def.in
@@ -24,7 +24,7 @@ __threadid
 __wcserror
 __wcserror_s
 ; DATA set manually
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _beginthread
 _beginthreadex
 _c_exit
diff --git a/mingw-w64-crt/lib-common/msvcr120_app.def.in 
b/mingw-w64-crt/lib-common/msvcr120_app.def.in
index 0963eea67..06260eee3 100644
--- a/mingw-w64-crt/lib-common/msvcr120_app.def.in
+++ b/mingw-w64-crt/lib-common/msvcr120_app.def.in
@@ -1179,7 +1179,7 @@ _aligned_offset_recalloc
 _aligned_realloc
 _aligned_recalloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in 
b/mingw-w64-crt/lib-common/msvcrt.def.in
index 790915920..39ece04fe 100644
--- a/mingw-w64-crt/lib-common/msvcrt.def.in
+++ b/mingw-w64-crt/lib-common/msvcrt.def.in
@@ -531,7 +531,7 @@ F_I386(_adj_fptan)
 F_I386(_adjust_fdiv DATA)
 _aexit_rtn DATA
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atoi64
 _atoldbl
diff --git a/mingw-w64-crt/lib-common/ucrtbase-common.def.in 
b/mingw-w64-crt/lib-common/ucrtbase-common.def.in
index a87d4da52..507e0af18 100644
--- a/mingw-w64-crt/lib-common/ucrtbase-common.def.in
+++ b/mingw-w64-crt/lib-common/ucrtbase-common.def.in
@@ -246,7 +246,7 @@ _aligned_realloc
 F_DEBUG(_aligned_realloc_dbg)
 _aligned_recalloc
 F_DEBUG(_aligned_recalloc_dbg)
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib32/crtdll.def.in 
b/mingw-w64-crt/lib32/crtdll.def.in
index 99ededa69..154d7add2 100644
--- a/mingw-w64-crt/lib32/crtdll.def.in
+++ b/mingw-w64-crt/lib32/crtdll.def.in
@@ -110,7 +110,7 @@ _acmdln DATA == _acmdln_dll
 _aexit_rtn_dll DATA
 _aexit_rtn DATA == _aexit_rtn_dll
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _basemajor_dll DATA
 _baseminor_dll DATA
 _baseversion_dll DATA
diff --git a/mingw-w64-crt/lib32/msvcr100.def.in 
b/mingw-w64-crt/lib32/msvcr100.def.in
index 50d31699a..1db3e0720 100644
--- a/mingw-w64-crt/lib32/msvcr100.def.in
+++ b/mingw-w64-crt/lib32/msvcr100.def.in
@@ -730,7 +730,7 @@ _aligned_offset_recalloc
 _aligned_realloc
 _aligned_recalloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib32/msvcr100d.def.in 
b/mingw-w64-crt/lib32/msvcr100d.def.in
index ee5717d07..9899fe057 100644
--- a/mingw-w64-crt/lib32/msvcr100d.def.in
+++ b/mingw-w64-crt/lib32/msvcr100d.def.in
@@ -777,7 +777,7 @@ _aligned_realloc_dbg
 _aligned_recalloc
 _aligned_recalloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib32/msvcr110.def.in 
b/mingw-w64-crt/lib32/msvcr110.def.in
index 09a7e68bf..1a4db8110 100644
--- a/mingw-w64-crt/lib32/msvcr110.def.in
+++ b/mingw-w64-crt/lib32/msvcr110.def.in
@@ -854,7 +854,7 @@ _aligned_offset_recalloc
 _aligned_realloc
 _aligned_recalloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib32/msvcr110d.def.in 
b/mingw-w64-crt/lib32/msvcr110d.def.in
index 3448d40e7..0b5269046 100644
--- a/mingw-w64-crt/lib32/msvcr110d.def.in
+++ b/mingw-w64-crt/lib32/msvcr110d.def.in
@@ -901,7 +901,7 @@ _aligned_realloc_dbg
 _aligned_recalloc
 _aligned_recalloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib32/msvcr120.def.in 
b/mingw-w64-crt/lib32/msvcr120.def.in
index 25933f156..af88bbbd5 100644
--- a/mingw-w64-crt/lib32/msvcr120.def.in
+++ b/mingw-w64-crt/lib32/msvcr120.def.in
@@ -865,7 +865,7 @@ _aligned_offset_recalloc
 _aligned_realloc
 _aligned_recalloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib32/msvcr120d.def.in 
b/mingw-w64-crt/lib32/msvcr120d.def.in
index e362dcd87..b8d4c9bb1 100644
--- a/mingw-w64-crt/lib32/msvcr120d.def.in
+++ b/mingw-w64-crt/lib32/msvcr120d.def.in
@@ -912,7 +912,7 @@ _aligned_realloc_dbg
 _aligned_recalloc
 _aligned_recalloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib32/msvcr40d.def.in 
b/mingw-w64-crt/lib32/msvcr40d.def.in
index 5f5f75409..aced5b3c5 100644
--- a/mingw-w64-crt/lib32/msvcr40d.def.in
+++ b/mingw-w64-crt/lib32/msvcr40d.def.in
@@ -1081,7 +1081,7 @@ _adj_fprem1
 _adj_fptan
 _adjust_fdiv DATA
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atoldbl
 _beep
diff --git a/mingw-w64-crt/lib32/msvcr70.def.in 
b/mingw-w64-crt/lib32/msvcr70.def.in
index 29a8aa95e..53e2bfe2d 100644
--- a/mingw-w64-crt/lib32/msvcr70.def.in
+++ b/mingw-w64-crt/lib32/msvcr70.def.in
@@ -258,7 +258,7 @@ _aligned_offset_malloc
 _aligned_offset_realloc
 _aligned_realloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atoi64
 _atoldbl
diff --git a/mingw-w64-crt/lib32/msvcr70d.def.in 
b/mingw-w64-crt/lib32/msvcr70d.def.in
index 3bbf5c542..7784d76f2 100644
--- a/mingw-w64-crt/lib32/msvcr70d.def.in
+++ b/mingw-w64-crt/lib32/msvcr70d.def.in
@@ -292,7 +292,7 @@ _aligned_offset_realloc_dbg
 _aligned_realloc
 _aligned_realloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atoi64
 _atoldbl
diff --git a/mingw-w64-crt/lib32/msvcr71.def.in 
b/mingw-w64-crt/lib32/msvcr71.def.in
index 6248aa604..aa33cd3d0 100644
--- a/mingw-w64-crt/lib32/msvcr71.def.in
+++ b/mingw-w64-crt/lib32/msvcr71.def.in
@@ -251,7 +251,7 @@ _aligned_offset_malloc
 _aligned_offset_realloc
 _aligned_realloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atoi64
 _atoldbl
diff --git a/mingw-w64-crt/lib32/msvcr71d.def.in 
b/mingw-w64-crt/lib32/msvcr71d.def.in
index 71fee41ac..a317d1ef2 100644
--- a/mingw-w64-crt/lib32/msvcr71d.def.in
+++ b/mingw-w64-crt/lib32/msvcr71d.def.in
@@ -285,7 +285,7 @@ _aligned_offset_realloc_dbg
 _aligned_realloc
 _aligned_realloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atoi64
 _atoldbl
diff --git a/mingw-w64-crt/lib32/msvcr80.def.in 
b/mingw-w64-crt/lib32/msvcr80.def.in
index d84908cc5..7d579983e 100644
--- a/mingw-w64-crt/lib32/msvcr80.def.in
+++ b/mingw-w64-crt/lib32/msvcr80.def.in
@@ -355,7 +355,7 @@ _aligned_offset_malloc
 _aligned_offset_realloc
 _aligned_realloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib32/msvcr80d.def.in 
b/mingw-w64-crt/lib32/msvcr80d.def.in
index 30302a197..d4deb170d 100644
--- a/mingw-w64-crt/lib32/msvcr80d.def.in
+++ b/mingw-w64-crt/lib32/msvcr80d.def.in
@@ -416,7 +416,7 @@ _aligned_realloc_dbg
 _aligned_recalloc
 _aligned_recalloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib32/msvcr90.def.in 
b/mingw-w64-crt/lib32/msvcr90.def.in
index 5c3d6a48c..a6f575212 100644
--- a/mingw-w64-crt/lib32/msvcr90.def.in
+++ b/mingw-w64-crt/lib32/msvcr90.def.in
@@ -355,7 +355,7 @@ _aligned_offset_recalloc
 _aligned_realloc
 _aligned_recalloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib32/msvcr90d.def.in 
b/mingw-w64-crt/lib32/msvcr90d.def.in
index 294cb57f8..eb4f68ec0 100644
--- a/mingw-w64-crt/lib32/msvcr90d.def.in
+++ b/mingw-w64-crt/lib32/msvcr90d.def.in
@@ -406,7 +406,7 @@ _aligned_realloc_dbg
 _aligned_recalloc
 _aligned_recalloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib32/msvcrt10.def.in 
b/mingw-w64-crt/lib32/msvcrt10.def.in
index ab6773406..8a7d40842 100644
--- a/mingw-w64-crt/lib32/msvcrt10.def.in
+++ b/mingw-w64-crt/lib32/msvcrt10.def.in
@@ -902,7 +902,7 @@ _access
 _acmdln DATA
 _aexit_rtn DATA
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 __msvcrt_beginthread == _beginthread ; rename _beginthread as it does not 
handle SSE floating point exceptions, real _beginthread provided by emu
 _c_exit
 _cabs
diff --git a/mingw-w64-crt/lib32/msvcrt20.def.in 
b/mingw-w64-crt/lib32/msvcrt20.def.in
index 0b13fc424..8a87561df 100644
--- a/mingw-w64-crt/lib32/msvcrt20.def.in
+++ b/mingw-w64-crt/lib32/msvcrt20.def.in
@@ -937,7 +937,7 @@ __msvcrt20_wgetmainargs == __wgetmainargs ; msvcrt20.dll's 
__wgetmainargs is inc
 _abnormal_termination
 _access
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atoldbl
 _beep
diff --git a/mingw-w64-crt/lib32/msvcrt40.def.in 
b/mingw-w64-crt/lib32/msvcrt40.def.in
index 95654f5f8..4c698c153 100644
--- a/mingw-w64-crt/lib32/msvcrt40.def.in
+++ b/mingw-w64-crt/lib32/msvcrt40.def.in
@@ -1055,7 +1055,7 @@ _adj_fprem1
 _adj_fptan
 _adjust_fdiv DATA
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atoldbl
 _beep
diff --git a/mingw-w64-crt/lib32/msvcrtd.def.in 
b/mingw-w64-crt/lib32/msvcrtd.def.in
index f7d5dce9f..ea0c17c3c 100644
--- a/mingw-w64-crt/lib32/msvcrtd.def.in
+++ b/mingw-w64-crt/lib32/msvcrtd.def.in
@@ -237,7 +237,7 @@ _adj_fptan
 _adjust_fdiv DATA
 _aexit_rtn DATA
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atoi64
 _atoldbl
diff --git a/mingw-w64-crt/lib64/msvcr100.def.in 
b/mingw-w64-crt/lib64/msvcr100.def.in
index 7e70caa86..2e7991c6d 100644
--- a/mingw-w64-crt/lib64/msvcr100.def.in
+++ b/mingw-w64-crt/lib64/msvcr100.def.in
@@ -687,7 +687,7 @@ _aligned_offset_recalloc
 _aligned_realloc
 _aligned_recalloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib64/msvcr100d.def.in 
b/mingw-w64-crt/lib64/msvcr100d.def.in
index 65ed8c2ca..26c568dc4 100644
--- a/mingw-w64-crt/lib64/msvcr100d.def.in
+++ b/mingw-w64-crt/lib64/msvcr100d.def.in
@@ -732,7 +732,7 @@ _aligned_realloc_dbg
 _aligned_recalloc
 _aligned_recalloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib64/msvcr110.def.in 
b/mingw-w64-crt/lib64/msvcr110.def.in
index aea6fabe6..83362bce9 100644
--- a/mingw-w64-crt/lib64/msvcr110.def.in
+++ b/mingw-w64-crt/lib64/msvcr110.def.in
@@ -813,7 +813,7 @@ _aligned_offset_recalloc
 _aligned_realloc
 _aligned_recalloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib64/msvcr110d.def.in 
b/mingw-w64-crt/lib64/msvcr110d.def.in
index ee51330b8..621768782 100644
--- a/mingw-w64-crt/lib64/msvcr110d.def.in
+++ b/mingw-w64-crt/lib64/msvcr110d.def.in
@@ -858,7 +858,7 @@ _aligned_realloc_dbg
 _aligned_recalloc
 _aligned_recalloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib64/msvcr120.def.in 
b/mingw-w64-crt/lib64/msvcr120.def.in
index 6442bb755..9095011ac 100644
--- a/mingw-w64-crt/lib64/msvcr120.def.in
+++ b/mingw-w64-crt/lib64/msvcr120.def.in
@@ -825,7 +825,7 @@ _aligned_offset_recalloc
 _aligned_realloc
 _aligned_recalloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib64/msvcr120d.def.in 
b/mingw-w64-crt/lib64/msvcr120d.def.in
index 51156e5d7..31c325805 100644
--- a/mingw-w64-crt/lib64/msvcr120d.def.in
+++ b/mingw-w64-crt/lib64/msvcr120d.def.in
@@ -870,7 +870,7 @@ _aligned_realloc_dbg
 _aligned_recalloc
 _aligned_recalloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib64/msvcr80.def.in 
b/mingw-w64-crt/lib64/msvcr80.def.in
index db1710d34..f81f10e29 100644
--- a/mingw-w64-crt/lib64/msvcr80.def.in
+++ b/mingw-w64-crt/lib64/msvcr80.def.in
@@ -298,7 +298,7 @@ _aligned_offset_malloc
 _aligned_offset_realloc
 _aligned_realloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib64/msvcr80d.def.in 
b/mingw-w64-crt/lib64/msvcr80d.def.in
index a28217c94..3fbac9478 100644
--- a/mingw-w64-crt/lib64/msvcr80d.def.in
+++ b/mingw-w64-crt/lib64/msvcr80d.def.in
@@ -353,7 +353,7 @@ _aligned_realloc_dbg
 _aligned_recalloc
 _aligned_recalloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib64/msvcr90.def.in 
b/mingw-w64-crt/lib64/msvcr90.def.in
index 1bc30455d..3efea2608 100644
--- a/mingw-w64-crt/lib64/msvcr90.def.in
+++ b/mingw-w64-crt/lib64/msvcr90.def.in
@@ -302,7 +302,7 @@ _aligned_offset_recalloc
 _aligned_realloc
 _aligned_recalloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/lib64/msvcr90d.def.in 
b/mingw-w64-crt/lib64/msvcr90d.def.in
index 864e0e10d..c95a741a8 100644
--- a/mingw-w64-crt/lib64/msvcr90d.def.in
+++ b/mingw-w64-crt/lib64/msvcr90d.def.in
@@ -347,7 +347,7 @@ _aligned_realloc_dbg
 _aligned_recalloc
 _aligned_recalloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/libarm32/msvcr110.def.in 
b/mingw-w64-crt/libarm32/msvcr110.def.in
index d70854050..3c067e002 100644
--- a/mingw-w64-crt/libarm32/msvcr110.def.in
+++ b/mingw-w64-crt/libarm32/msvcr110.def.in
@@ -807,7 +807,7 @@ _aligned_offset_recalloc
 _aligned_realloc
 _aligned_recalloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/libarm32/msvcr110d.def.in 
b/mingw-w64-crt/libarm32/msvcr110d.def.in
index 80a3e3029..7164dbb88 100644
--- a/mingw-w64-crt/libarm32/msvcr110d.def.in
+++ b/mingw-w64-crt/libarm32/msvcr110d.def.in
@@ -852,7 +852,7 @@ _aligned_realloc_dbg
 _aligned_recalloc
 _aligned_recalloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/libarm32/msvcr120.def.in 
b/mingw-w64-crt/libarm32/msvcr120.def.in
index 3a2f9267e..8e3b65f26 100644
--- a/mingw-w64-crt/libarm32/msvcr120.def.in
+++ b/mingw-w64-crt/libarm32/msvcr120.def.in
@@ -799,7 +799,7 @@ _aligned_offset_recalloc
 _aligned_realloc
 _aligned_recalloc
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/libarm32/msvcr120d.def.in 
b/mingw-w64-crt/libarm32/msvcr120d.def.in
index 4380106fa..ef278913e 100644
--- a/mingw-w64-crt/libarm32/msvcr120d.def.in
+++ b/mingw-w64-crt/libarm32/msvcr120d.def.in
@@ -844,7 +844,7 @@ _aligned_realloc_dbg
 _aligned_recalloc
 _aligned_recalloc_dbg
 _amsg_exit
-__msvcrt_assert DATA == _assert ; mingw-w64 provides _assert() function as 
wrapper around renamed __msvcrt_assert symbol
+_assert
 _atodbl
 _atodbl_l
 _atof_l
diff --git a/mingw-w64-crt/misc/_assert.c b/mingw-w64-crt/misc/_assert.c
deleted file mode 100644
index c8c854820..000000000
--- a/mingw-w64-crt/misc/_assert.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * This file has no copyright assigned and is placed in the Public Domain.
- * This file is part of the mingw-w64 runtime package.
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
- */
-
-#include <assert.h>
-#include <fcntl.h>
-#include <io.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-/* This is import symbol name for "_assert" from CRT DLL library */
-extern void (__cdecl *__MINGW_IMP_SYMBOL(__msvcrt_assert))(const char 
*message, const char *file, unsigned line);
-
-/* Turn off _O_WTEXT, _O_U16TEXT or _O_U8TEXT mode on stderr stream
- * by changing mode to _O_TEXT, because fprintf (called by __msvcrt_assert)
- * does not work (and does nothing) on FILE* stream in some of those modes.
- * Only fwprintf works with those modes, but _assert uses fprintf.
- * Before changing the FILE* stream mode, it is required to flush buffers. */
-void __cdecl _assert(const char *message, const char *file, unsigned line)
-{
-  /* stderr expands to function call */
-  FILE *stream = stderr;
-  /* Cache fd used by `stderr` */
-  int fd = _fileno (stream);
-  /* We need to restore previous mode in case `_assert` returns; it can happen
-   * if program has called _set_error_mode(_OUT_TO_MSGBOX) and user pressed
-   * "Ignore" button in popped up message box. */
-  int oldmode;
-
-  /* Change `stderr` mode to `_O_TEXT` */
-  fflush(stream);
-  oldmode = _setmode(fd, _O_TEXT);
-
-  /* Call CRT `_assert` */
-  __MINGW_IMP_SYMBOL(__msvcrt_assert)(message, file, line);
-
-  /* Restore `stderr` mode to `oldmode` */
-  fflush (stream);
-  if (_setmode (fd, oldmode) != _O_TEXT) {
-    abort ();
-  }
-}
-
-void (__cdecl *__MINGW_IMP_SYMBOL(_assert))(const char *message, const char 
*file, unsigned line) = _assert;
diff --git a/mingw-w64-headers/crt/assert.h b/mingw-w64-headers/crt/assert.h
index 5dd20e2fa..49be07875 100644
--- a/mingw-w64-headers/crt/assert.h
+++ b/mingw-w64-headers/crt/assert.h
@@ -19,8 +19,8 @@
 
 _CRT_BEGIN_C_HEADER
 
+_CRTIMP void __cdecl _assert (const char *_Message, const char *_File, 
unsigned _Line);
 _CRTIMP void __cdecl _wassert(const wchar_t *_Message,const wchar_t 
*_File,unsigned _Line);
-void __cdecl _assert (const char *_Message, const char *_File, unsigned _Line);
 
 _CRT_END_C_HEADER
 
-- 
2.55.0.windows.3

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to