crt: Provide onexit symbol alias

Now when there is working _onexit() function, provide also onexit() aliased
function, which already has declaration in stdlib.h header file.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Pali Rohár 2024-09-21 14:29:03 +02:00 committed by Martin Storsjö
parent 23414487df
commit d2491a9358
2 changed files with 4 additions and 1 deletions

View File

@ -115,7 +115,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)

View File

@ -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);