mirror of
https://github.com/reactos/reactos.git
synced 2025-06-20 04:25:29 +00:00
Create a branch for header work.
svn path=/branches/header-work/; revision=45691
This commit is contained in:
parent
14fe274b1c
commit
9ea495ba33
19538 changed files with 0 additions and 1063950 deletions
|
@ -1,69 +0,0 @@
|
|||
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
|
||||
#include <precomp.h>
|
||||
|
||||
void _atexit_cleanup(void)
|
||||
{
|
||||
struct __atexit *next, *a = __atexit_ptr;
|
||||
__atexit_ptr = 0; /* to prevent infinite loops */
|
||||
while (a)
|
||||
{
|
||||
(a->__function)();
|
||||
next = a->__next;
|
||||
free(a);
|
||||
a = next;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*
|
||||
* Ported from WINE
|
||||
* Copyright (C) 2000 Jon Griffiths
|
||||
*/
|
||||
_onexit_t __dllonexit(_onexit_t func, _onexit_t **start, _onexit_t **end)
|
||||
{
|
||||
_onexit_t *tmp;
|
||||
int len;
|
||||
|
||||
if (!start || !*start || !end || !*end)
|
||||
return NULL;
|
||||
|
||||
len = (*end - *start);
|
||||
if (++len <= 0)
|
||||
return NULL;
|
||||
|
||||
tmp = (_onexit_t *)realloc(*start, len * sizeof(tmp));
|
||||
if (!tmp)
|
||||
return NULL;
|
||||
|
||||
*start = tmp;
|
||||
*end = tmp + len;
|
||||
tmp[len - 1] = func;
|
||||
|
||||
return func;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
_onexit_t _onexit(_onexit_t a)
|
||||
{
|
||||
struct __atexit *ap;
|
||||
if (a == 0)
|
||||
return NULL;
|
||||
ap = (struct __atexit *)malloc(sizeof(struct __atexit));
|
||||
if (!ap)
|
||||
return NULL;
|
||||
ap->__next = __atexit_ptr;
|
||||
ap->__function = (void (*)(void))a;
|
||||
__atexit_ptr = ap;
|
||||
return a;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
int atexit(void (*a)(void))
|
||||
{
|
||||
return _onexit((_onexit_t)a) == (_onexit_t)a ? 0 : -1;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue