2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
6 #include "__stdc_intbase.h"
8 #include <aros/symbolsets.h>
9 #include <exec/lists.h>
10 #include "__exitfunc.h"
12 int __addexitfunc(struct AtExitNode
*aen
)
14 struct StdCIntBase
*StdCBase
=
15 (struct StdCIntBase
*)__aros_getbase_StdCBase();
17 ADDHEAD((struct List
*)&StdCBase
->atexit_list
, (struct Node
*)aen
);
22 int __init_atexit(struct StdCIntBase
*StdCBase
)
24 NEWLIST((struct List
*)&StdCBase
->atexit_list
);
29 void __callexitfuncs(void)
31 struct StdCIntBase
*StdCBase
=
32 (struct StdCIntBase
*)__aros_getbase_StdCBase();
33 struct AtExitNode
*aen
;
36 (aen
= (struct AtExitNode
*) REMHEAD((struct List
*) &StdCBase
->atexit_list
))
39 switch (aen
->node
.ln_Type
)
47 int *errorptr
= __stdc_get_errorptr();
48 aen
->func
.fptr(errorptr
!= NULL
? *errorptr
: 0, aen
->ptr
);
55 ADD2OPENLIB(__init_atexit
, 100);