mingw-w64 startup code already provides its own atexit() functions.
Implementation for DLL and EXE builds differs because version for DLL
builds has to be called at the time when unloading DLL library whereas
version for EXE builds is called at process termination. DLL version of
atexit() stores atexit's function pointers into own table which is called
from DLL unload hook. EXE version just calls CRT's _onexit() function.
Some msvcrt def files provide atexit function symbol without DATA keyword,
which is than exported from msvcrt import library. And so it conflicts with
the atexit symbol from startup file and makes atexit function unusable.
UCRT libraries do not have this problem because they provide atexit
function under different name _crt_atexit.
Fix msvcrt symbol conflicts by renaming atexit function to _crt_atexit in
every CRT def file. This will ensure compatibility with UCRT and also that
applications would call atexit function from mingw-w64 startup file and not
from CRT import library.
Also change atexit implementation in exe startup file to directly call
_crt_atexit() function instead of _onexit(). This will simplify usage as
UCRT does not have _onexit() function (mingw-w64 provides only _onexit
wrapper around _crt_atexit) and msvcrt's atexit() function (renamed to
_crt_atexit() in def file) is doing same thing as msvcrt _onexit().
---
mingw-w64-crt/Makefile.am | 2 +-
mingw-w64-crt/crt/atexit.c | 10 ++++++++++
mingw-w64-crt/crt/crtdll.c | 2 ++
mingw-w64-crt/crt/crtexe.c | 8 +++++++-
mingw-w64-crt/lib-common/msvcr120_app.def.in | 2 +-
mingw-w64-crt/lib-common/msvcrt.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/kernelbase.def | 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 +-
41 files changed, 57 insertions(+), 39 deletions(-)
create mode 100644 mingw-w64-crt/crt/atexit.c
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index d497fa76b124..03580d5cdb00 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -117,7 +117,7 @@ src_libmingw32=include/oscalls.h include/internal.h
include/sect_attribs.h \
crt/usermatherr.c \
crt/xtxtmode.c crt/crt_handler.c \
crt/tlsthrd.c crt/tlsmthread.c crt/tlsmcrt.c \
- crt/cxa_atexit.c crt/cxa_thread_atexit.c crt/tls_atexit.c
+ crt/cxa_atexit.c crt/cxa_thread_atexit.c crt/tls_atexit.c crt/atexit.c
src_libscrnsave=libsrc/scrnsave.c
src_libscrnsavw=libsrc/scrnsave.c
diff --git a/mingw-w64-crt/crt/atexit.c b/mingw-w64-crt/crt/atexit.c
new file mode 100644
index 000000000000..f49f4cb80d61
--- /dev/null
+++ b/mingw-w64-crt/crt/atexit.c
@@ -0,0 +1,10 @@
+/**
+ * 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 <stdlib.h>
+
+/* define just import symbol, function itself is in crtexe.c and crtdll.c
files */
+int (__cdecl *__MINGW_IMP_SYMBOL(atexit))(void (__cdecl *)(void)) = atexit;
diff --git a/mingw-w64-crt/crt/crtdll.c b/mingw-w64-crt/crt/crtdll.c
index 88450ce9f74f..d08d2a81f0dd 100644
--- a/mingw-w64-crt/crt/crtdll.c
+++ b/mingw-w64-crt/crt/crtdll.c
@@ -204,6 +204,8 @@ i__leave:
int __cdecl atexit (_PVFV func)
{
+ /* Do not use msvcrt's atexit() or UCRT's _crt_atexit() function as it
+ * cannot be called from DLL library which may be unloaded at runtime. */
return _register_onexit_function(&atexit_table, (_onexit_t)func);
}
diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c
index 2e45bf423812..cdf5dcd25894 100644
--- a/mingw-w64-crt/crt/crtexe.c
+++ b/mingw-w64-crt/crt/crtexe.c
@@ -20,6 +20,7 @@
#include <tchar.h>
#include <sect_attribs.h>
#include <locale.h>
+#include <corecrt_startup.h>
#if defined(__SEH__) && (!defined(__clang__) || __clang_major__ >= 7)
#define SEH_INLINE_ASM
@@ -325,7 +326,12 @@ static void duplicate_ppstrings (int ac, _TCHAR ***av)
int __cdecl atexit (_PVFV func)
{
- return _onexit((_onexit_t)func) ? 0 : -1;
+ /*
+ * msvcrt def file renames the real atexit() function to _crt_atexit().
+ * UCRT provides atexit() function only under name _crt_atexit().
+ * So redirect call to _crt_atexit() function.
+ */
+ return _crt_atexit(func);
}
char __mingw_module_is_dll = 0;
diff --git a/mingw-w64-crt/lib-common/msvcr120_app.def.in
b/mingw-w64-crt/lib-common/msvcr120_app.def.in
index 67f8f8a57396..48f3df0cd4d3 100644
--- a/mingw-w64-crt/lib-common/msvcr120_app.def.in
+++ b/mingw-w64-crt/lib-common/msvcr120_app.def.in
@@ -1870,7 +1870,7 @@ F_NON_I386(atanf)
atanh
atanhf
F_ARM32(atanhl) ; Can't use long double functions from the CRT on x86
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in
b/mingw-w64-crt/lib-common/msvcrt.def.in
index 64e978088329..fe2bf2526afe 100644
--- a/mingw-w64-crt/lib-common/msvcrt.def.in
+++ b/mingw-w64-crt/lib-common/msvcrt.def.in
@@ -937,7 +937,7 @@ asctime
asin
atan
atan2 F_X86_ANY(DATA)
-atexit DATA
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/crtdll.def.in
b/mingw-w64-crt/lib32/crtdll.def.in
index e0626d58ddee..f5a2939dba62 100644
--- a/mingw-w64-crt/lib32/crtdll.def.in
+++ b/mingw-w64-crt/lib32/crtdll.def.in
@@ -433,7 +433,7 @@ asctime
asin DATA
atan DATA
atan2 DATA
-atexit DATA
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr100.def.in
b/mingw-w64-crt/lib32/msvcr100.def.in
index fda12255ab79..a7646f588b73 100644
--- a/mingw-w64-crt/lib32/msvcr100.def.in
+++ b/mingw-w64-crt/lib32/msvcr100.def.in
@@ -1656,7 +1656,7 @@ asctime_s
asin
atan
atan2 DATA
-atexit DATA
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr100d.def.in
b/mingw-w64-crt/lib32/msvcr100d.def.in
index c7616a8f08be..0a54d464e885 100644
--- a/mingw-w64-crt/lib32/msvcr100d.def.in
+++ b/mingw-w64-crt/lib32/msvcr100d.def.in
@@ -1723,7 +1723,7 @@ asctime_s
asin
atan
atan2 DATA ; overwritten
-atexit DATA ; overwritten
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr110.def.in
b/mingw-w64-crt/lib32/msvcr110.def.in
index eb45326d5e75..a041054ce032 100644
--- a/mingw-w64-crt/lib32/msvcr110.def.in
+++ b/mingw-w64-crt/lib32/msvcr110.def.in
@@ -1789,7 +1789,7 @@ asctime_s
asin
atan
atan2 DATA
-atexit DATA
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr110d.def.in
b/mingw-w64-crt/lib32/msvcr110d.def.in
index 2dcd3b3713a9..a0d385785100 100644
--- a/mingw-w64-crt/lib32/msvcr110d.def.in
+++ b/mingw-w64-crt/lib32/msvcr110d.def.in
@@ -1856,7 +1856,7 @@ asctime_s
asin
atan
atan2 DATA ; overwritten
-atexit DATA ; overwritten
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr120.def.in
b/mingw-w64-crt/lib32/msvcr120.def.in
index f4528989828b..2551b3062fa6 100644
--- a/mingw-w64-crt/lib32/msvcr120.def.in
+++ b/mingw-w64-crt/lib32/msvcr120.def.in
@@ -1846,7 +1846,7 @@ atan2
atanh
atanhf
; atanhl ; Can't use long double functions from the CRT on x86
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr120d.def.in
b/mingw-w64-crt/lib32/msvcr120d.def.in
index f30ae72e1a9a..d8272600f939 100644
--- a/mingw-w64-crt/lib32/msvcr120d.def.in
+++ b/mingw-w64-crt/lib32/msvcr120d.def.in
@@ -1913,7 +1913,7 @@ atan2
atanh
atanhf
; atanhl ; Can't use long double functions from the CRT on x86
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr40d.def.in
b/mingw-w64-crt/lib32/msvcr40d.def.in
index 2d0af6c7d7a8..5d1372e1e9d8 100644
--- a/mingw-w64-crt/lib32/msvcr40d.def.in
+++ b/mingw-w64-crt/lib32/msvcr40d.def.in
@@ -1461,7 +1461,7 @@ asctime
asin
atan
atan2
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr70.def.in
b/mingw-w64-crt/lib32/msvcr70.def.in
index c167523e72c4..91ae74a6cea4 100644
--- a/mingw-w64-crt/lib32/msvcr70.def.in
+++ b/mingw-w64-crt/lib32/msvcr70.def.in
@@ -711,7 +711,7 @@ asctime
asin
atan
atan2
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr70d.def.in
b/mingw-w64-crt/lib32/msvcr70d.def.in
index bc5a32b6abed..0016d3620596 100644
--- a/mingw-w64-crt/lib32/msvcr70d.def.in
+++ b/mingw-w64-crt/lib32/msvcr70d.def.in
@@ -755,7 +755,7 @@ asctime
asin
atan
atan2
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr71.def.in
b/mingw-w64-crt/lib32/msvcr71.def.in
index c1b7ce2d1b15..a130a77b06a0 100644
--- a/mingw-w64-crt/lib32/msvcr71.def.in
+++ b/mingw-w64-crt/lib32/msvcr71.def.in
@@ -705,7 +705,7 @@ asctime
asin
atan
atan2
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr71d.def.in
b/mingw-w64-crt/lib32/msvcr71d.def.in
index 806602207e0e..7ad3b594fde7 100644
--- a/mingw-w64-crt/lib32/msvcr71d.def.in
+++ b/mingw-w64-crt/lib32/msvcr71d.def.in
@@ -749,7 +749,7 @@ asctime
asin
atan
atan2
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr80.def.in
b/mingw-w64-crt/lib32/msvcr80.def.in
index 107356849a7d..f15ea5d3f076 100644
--- a/mingw-w64-crt/lib32/msvcr80.def.in
+++ b/mingw-w64-crt/lib32/msvcr80.def.in
@@ -1297,7 +1297,7 @@ asctime_s
asin
atan
atan2 DATA
-atexit DATA
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr80d.def.in
b/mingw-w64-crt/lib32/msvcr80d.def.in
index 1e461af4d3e0..3340a189a353 100644
--- a/mingw-w64-crt/lib32/msvcr80d.def.in
+++ b/mingw-w64-crt/lib32/msvcr80d.def.in
@@ -1380,7 +1380,7 @@ asctime_s
asin
atan
atan2 DATA ; overwritten
-atexit DATA ; overwritten
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr90.def.in
b/mingw-w64-crt/lib32/msvcr90.def.in
index c8ae0be94ce7..cf15aa62f1d9 100644
--- a/mingw-w64-crt/lib32/msvcr90.def.in
+++ b/mingw-w64-crt/lib32/msvcr90.def.in
@@ -1290,7 +1290,7 @@ asctime_s
asin
atan
atan2 DATA
-atexit DATA
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcr90d.def.in
b/mingw-w64-crt/lib32/msvcr90d.def.in
index 1e88f71753fc..3267aa2e7af5 100644
--- a/mingw-w64-crt/lib32/msvcr90d.def.in
+++ b/mingw-w64-crt/lib32/msvcr90d.def.in
@@ -1362,7 +1362,7 @@ asctime_s
asin
atan
atan2 DATA
-atexit DATA
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcrt10.def.in
b/mingw-w64-crt/lib32/msvcrt10.def.in
index 66cb07c15429..c5ec60458214 100644
--- a/mingw-w64-crt/lib32/msvcrt10.def.in
+++ b/mingw-w64-crt/lib32/msvcrt10.def.in
@@ -1112,7 +1112,7 @@ asctime
asin
atan
atan2
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcrt20.def.in
b/mingw-w64-crt/lib32/msvcrt20.def.in
index 7330274d6789..9fc9f8ed8083 100644
--- a/mingw-w64-crt/lib32/msvcrt20.def.in
+++ b/mingw-w64-crt/lib32/msvcrt20.def.in
@@ -1329,7 +1329,7 @@ asctime
asin
atan
atan2
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcrt40.def.in
b/mingw-w64-crt/lib32/msvcrt40.def.in
index 26a7453cc10c..1a9cbc210a3c 100644
--- a/mingw-w64-crt/lib32/msvcrt40.def.in
+++ b/mingw-w64-crt/lib32/msvcrt40.def.in
@@ -1429,7 +1429,7 @@ asctime
asin
atan
atan2
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib32/msvcrtd.def.in
b/mingw-w64-crt/lib32/msvcrtd.def.in
index ee667003046a..c54c9a9a9f49 100644
--- a/mingw-w64-crt/lib32/msvcrtd.def.in
+++ b/mingw-w64-crt/lib32/msvcrtd.def.in
@@ -655,7 +655,7 @@ asctime
asin
atan
atan2
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib64/msvcr100.def.in
b/mingw-w64-crt/lib64/msvcr100.def.in
index 8b8ba49c62ca..af3beefbd3a7 100644
--- a/mingw-w64-crt/lib64/msvcr100.def.in
+++ b/mingw-w64-crt/lib64/msvcr100.def.in
@@ -1606,7 +1606,7 @@ atan
atan2 DATA
atan2f DATA
atanf DATA
-atexit DATA
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib64/msvcr100d.def.in
b/mingw-w64-crt/lib64/msvcr100d.def.in
index b07bd4c95efe..b8b54ee1014d 100644
--- a/mingw-w64-crt/lib64/msvcr100d.def.in
+++ b/mingw-w64-crt/lib64/msvcr100d.def.in
@@ -1671,7 +1671,7 @@ atan
atan2 DATA ; overwritten
atan2f DATA ; overwritten
atanf DATA ; overwritten
-atexit DATA ; overwritten
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib64/msvcr110.def.in
b/mingw-w64-crt/lib64/msvcr110.def.in
index 2c2c9fbb9710..e39f93ee9da8 100644
--- a/mingw-w64-crt/lib64/msvcr110.def.in
+++ b/mingw-w64-crt/lib64/msvcr110.def.in
@@ -1730,7 +1730,7 @@ atan
atan2 DATA
atan2f DATA
atanf DATA
-atexit DATA
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib64/msvcr110d.def.in
b/mingw-w64-crt/lib64/msvcr110d.def.in
index 9f7bcf9886ae..dfcd60360586 100644
--- a/mingw-w64-crt/lib64/msvcr110d.def.in
+++ b/mingw-w64-crt/lib64/msvcr110d.def.in
@@ -1795,7 +1795,7 @@ atan
atan2 DATA ; overwritten
atan2f DATA ; overwritten
atanf DATA ; overwritten
-atexit DATA ; overwritten
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib64/msvcr120.def.in
b/mingw-w64-crt/lib64/msvcr120.def.in
index 65637518b526..3f517eb58df6 100644
--- a/mingw-w64-crt/lib64/msvcr120.def.in
+++ b/mingw-w64-crt/lib64/msvcr120.def.in
@@ -1788,7 +1788,7 @@ atanf
atanh
atanhf
; atanhl ; Can't use long double functions from the CRT on x86
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib64/msvcr120d.def.in
b/mingw-w64-crt/lib64/msvcr120d.def.in
index 5d975164dcdb..364cc1fb2721 100644
--- a/mingw-w64-crt/lib64/msvcr120d.def.in
+++ b/mingw-w64-crt/lib64/msvcr120d.def.in
@@ -1853,7 +1853,7 @@ atanf
atanh
atanhf
; atanhl ; Can't use long double functions from the CRT on x86
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib64/msvcr80.def.in
b/mingw-w64-crt/lib64/msvcr80.def.in
index 3c15764a6378..a5690aab713d 100644
--- a/mingw-w64-crt/lib64/msvcr80.def.in
+++ b/mingw-w64-crt/lib64/msvcr80.def.in
@@ -1229,7 +1229,7 @@ atan
atan2 DATA
atan2f DATA
atanf DATA
-atexit DATA
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib64/msvcr80d.def.in
b/mingw-w64-crt/lib64/msvcr80d.def.in
index 00d217352fab..e829294dd523 100644
--- a/mingw-w64-crt/lib64/msvcr80d.def.in
+++ b/mingw-w64-crt/lib64/msvcr80d.def.in
@@ -1306,7 +1306,7 @@ atan
atan2 DATA ; overwritten
atan2f DATA ; overwritten
atanf DATA ; overwritten
-atexit DATA ; ovetwritten
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib64/msvcr90.def.in
b/mingw-w64-crt/lib64/msvcr90.def.in
index 4e4c57351197..8143378cec55 100644
--- a/mingw-w64-crt/lib64/msvcr90.def.in
+++ b/mingw-w64-crt/lib64/msvcr90.def.in
@@ -1226,7 +1226,7 @@ atan
atan2 DATA
atan2f DATA
atanf DATA
-atexit DATA
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/lib64/msvcr90d.def.in
b/mingw-w64-crt/lib64/msvcr90d.def.in
index ef03d6ac0c34..c066bebc067d 100644
--- a/mingw-w64-crt/lib64/msvcr90d.def.in
+++ b/mingw-w64-crt/lib64/msvcr90d.def.in
@@ -1292,7 +1292,7 @@ atan
atan2 DATA
atan2f DATA
atanf DATA
-atexit DATA
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/libarm32/kernelbase.def
b/mingw-w64-crt/libarm32/kernelbase.def
index 954ea2dc1124..90c91ab2bea4 100644
--- a/mingw-w64-crt/libarm32/kernelbase.def
+++ b/mingw-w64-crt/libarm32/kernelbase.def
@@ -1889,7 +1889,7 @@ _invalid_parameter
_onexit
_purecall
_time64
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
exit
hgets
hwprintf
diff --git a/mingw-w64-crt/libarm32/msvcr110.def.in
b/mingw-w64-crt/libarm32/msvcr110.def.in
index 8f30767a8d1b..8bced221e694 100644
--- a/mingw-w64-crt/libarm32/msvcr110.def.in
+++ b/mingw-w64-crt/libarm32/msvcr110.def.in
@@ -1716,7 +1716,7 @@ atan
atan2
atan2f
atanf
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/libarm32/msvcr110d.def.in
b/mingw-w64-crt/libarm32/msvcr110d.def.in
index 5a809682d6d1..584bf08d3633 100644
--- a/mingw-w64-crt/libarm32/msvcr110d.def.in
+++ b/mingw-w64-crt/libarm32/msvcr110d.def.in
@@ -1781,7 +1781,7 @@ atan
atan2
atan2f
atanf
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/libarm32/msvcr120.def.in
b/mingw-w64-crt/libarm32/msvcr120.def.in
index 4483a209325f..a9e717d64599 100644
--- a/mingw-w64-crt/libarm32/msvcr120.def.in
+++ b/mingw-w64-crt/libarm32/msvcr120.def.in
@@ -1753,7 +1753,7 @@ atanf
atanh
atanhf
atanhl
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
diff --git a/mingw-w64-crt/libarm32/msvcr120d.def.in
b/mingw-w64-crt/libarm32/msvcr120d.def.in
index 90374f7e901f..b1a4eff7fb76 100644
--- a/mingw-w64-crt/libarm32/msvcr120d.def.in
+++ b/mingw-w64-crt/libarm32/msvcr120d.def.in
@@ -1818,7 +1818,7 @@ atanf
atanh
atanhf
atanhl
-atexit
+_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with
UCRT, real atexit function provided by mingw-w64
atof
atoi
atol
--
2.20.1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public