mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-16 03:19:54 +08:00
e2ac49d3d7
Lite exit support. * README: Add information about lite-exit. * acconfig.h (_LITE_EXIT): New macro. * configure.in (enable-lite-exit): New option. (_LITE_EXIT): Define new macro. * configure: Regenerated. * newlib.hin (_LITE_EXIT): New macro. * libc/stdlib/__atexit.c [_LITE_EXIT]: Add dummy explicit reference to __call_exitprocs. * libc/stdlib/cxa_atexit.c [_LITE_EXIT]: Make __register_exitproc a weak reference. * libc/stdlib/exit.c (exit)[_LITE_EXIT]: Remove TWS and weakly reference __call_exitprocs.
33 lines
632 B
C
33 lines
632 B
C
/*
|
|
* Implementation of __cxa_atexit.
|
|
*/
|
|
|
|
#include <stddef.h>
|
|
#include <stdlib.h>
|
|
#include <reent.h>
|
|
#include <sys/lock.h>
|
|
#include "atexit.h"
|
|
|
|
/*
|
|
* Register a function to be performed at exit or DSO unload.
|
|
*/
|
|
|
|
int
|
|
_DEFUN (__cxa_atexit,
|
|
(fn, arg, d),
|
|
void (*fn) (void *) _AND
|
|
void *arg _AND
|
|
void *d)
|
|
{
|
|
#ifdef _LITE_EXIT
|
|
/* Refer to comments in __atexit.c for more details of lite exit. */
|
|
int __register_exitproc _PARAMS ((int, void (*fn) (void), _PTR, _PTR))
|
|
__attribute__ ((weak));
|
|
|
|
if (!__register_exitproc)
|
|
return 0;
|
|
else
|
|
#endif
|
|
return __register_exitproc (__et_cxa, (void (*)(void)) fn, arg, d);
|
|
}
|