add a missing section header table index conversion
[tangerine.git] / compiler / clib / on_exit.c
bloba25dff4ffa10c33fcb4aadfc4354cf82f10c0f69
1 /*
2 Copyright © 1995-2002, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <stdlib.h>
7 #include "__exitfunc.h"
9 int on_exit(void (*func)(int, void *), void *arg)
11 struct AtExitNode *aen = malloc(sizeof(*aen));
13 if (!aen) return -1;
15 aen->node.ln_Type = AEN_PTR;
16 aen->func.fptr = func;
17 aen->ptr = arg;
19 return __addexitfunc(aen);