Now when there is working _onexit() function, provide also onexit() aliased
function, which already has declaration in stdlib.h header file.
---
 mingw-w64-crt/def-include/crt-aliases.def.in | 2 +-
 mingw-w64-crt/misc/_onexit.c                 | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/mingw-w64-crt/def-include/crt-aliases.def.in 
b/mingw-w64-crt/def-include/crt-aliases.def.in
index d81eaae2596b..dfa022d33cf1 100644
--- a/mingw-w64-crt/def-include/crt-aliases.def.in
+++ b/mingw-w64-crt/def-include/crt-aliases.def.in
@@ -111,7 +111,7 @@ ADD_UNDERSCORE(memccpy)
 ADD_UNDERSCORE(memicmp)
 ADD_UNDERSCORE(mkdir)
 ADD_UNDERSCORE(mktemp)
-; ADD_UNDERSCORE(onexit)
+; onexit function alias is provided by misc/_onexit.c
 ADD_UNDERSCORE(open)
 #ifndef CRTAPP
 ADD_UNDERSCORE(putch)
diff --git a/mingw-w64-crt/misc/_onexit.c b/mingw-w64-crt/misc/_onexit.c
index 9caf0f75de72..a51fa3fc9058 100644
--- a/mingw-w64-crt/misc/_onexit.c
+++ b/mingw-w64-crt/misc/_onexit.c
@@ -11,3 +11,6 @@ _onexit_t __cdecl _onexit(_onexit_t func)
   return atexit((void (__cdecl *)(void))func) == 0 ? func : NULL;
 }
 _onexit_t __cdecl (*__MINGW_IMP_SYMBOL(_onexit))(_onexit_t func) = _onexit;
+
+_onexit_t __attribute__ ((alias ("_onexit"))) __cdecl onexit(_onexit_t);
+extern _onexit_t (__cdecl * __attribute__ ((alias 
(__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(_onexit))))) 
__MINGW_IMP_SYMBOL(onexit))(_onexit_t);
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to