mirror of
https://github.com/reactos/reactos.git
synced 2025-06-25 11:59:45 +00:00
[VCSTARTUP] Implement atexit and _onexit
These must use a local table and cannot use the one from ucrtbase. The table is initialized with a .CRT section initializer.
This commit is contained in:
parent
fce48c3014
commit
f81c82f5fa
4 changed files with 55 additions and 0 deletions
18
sdk/lib/vcruntime/atexit.c
Normal file
18
sdk/lib/vcruntime/atexit.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// atexit.c
|
||||
//
|
||||
// Copyright (c) 2024 Timo Kreuzer
|
||||
//
|
||||
// Implementation of atexit.
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
int __cdecl atexit(void (__cdecl* _Func)(void))
|
||||
{
|
||||
// Go through _onexit, so that the initializer is pulled in.
|
||||
_onexit_t result = _onexit((_onexit_t)_Func);
|
||||
return (result == NULL) ? -1 : 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue