2007-03-14 20:24:57 +00:00
|
|
|
#include <precomp.h>
|
|
|
|
#include <internal/atexit.h>
|
|
|
|
|
2008-07-31 17:46:50 +00:00
|
|
|
extern void _atexit_cleanup(void);
|
|
|
|
|
2007-03-14 20:24:57 +00:00
|
|
|
struct __atexit *__atexit_ptr = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
void exit(int status)
|
|
|
|
{
|
|
|
|
//int i;
|
|
|
|
|
|
|
|
/*
|
|
|
|
if (__stdio_cleanup_hook)
|
|
|
|
__stdio_cleanup_hook();
|
|
|
|
for (i=0; i<djgpp_last_dtor-djgpp_first_dtor; i++)
|
|
|
|
djgpp_first_dtor[i]();
|
|
|
|
*/
|
|
|
|
/* in case the program set it this way */
|
2009-08-06 11:03:08 +00:00
|
|
|
_setmode(0, _O_TEXT);
|
2008-07-31 17:46:50 +00:00
|
|
|
_atexit_cleanup();
|
2007-03-14 20:24:57 +00:00
|
|
|
_exit(status);
|
|
|
|
for(;;);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
void _exit(int _status)
|
|
|
|
{
|
2008-07-31 17:46:50 +00:00
|
|
|
// FIXME: _exit and _c_exit should prevent atexit routines from being called during DLL unload
|
2007-03-14 20:24:57 +00:00
|
|
|
ExitProcess(_status);
|
|
|
|
for(;;);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
void _cexit( void )
|
|
|
|
{
|
2008-07-31 17:46:50 +00:00
|
|
|
_atexit_cleanup();
|
2007-03-14 20:24:57 +00:00
|
|
|
// flush
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
void _c_exit( void )
|
|
|
|
{
|
2008-07-31 17:46:50 +00:00
|
|
|
// FIXME: _exit and _c_exit should prevent atexit routines from being called during DLL unload
|
2007-03-14 20:24:57 +00:00
|
|
|
// reset interup vectors
|
|
|
|
}
|