Hello, Here's slightly updated version of the patch I sent back in June, which wasn't pushed due to disagreement on how to handle `_assert` wrapper.
- Kirill Makurin
From 66f26ae7553177e842fa34b82b4ca21b6a1c604b Mon Sep 17 00:00:00 2001 From: Kirill Makurin <[email protected]> Date: Mon, 14 Sep 2026 18:59:00 +0900 Subject: [PATCH] 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
