Use free Windows DDK and compile with latest MinGW releases.
[reactos.git] / reactos / lib / msvcrt / stdlib / _exit.c
1 #include <msvcrti.h>
2
3
4 struct __atexit *__atexit_ptr = 0;
5
6 void exit(int status)
7 {
8 //int i;
9 struct __atexit *a = __atexit_ptr;
10 __atexit_ptr = 0; /* to prevent infinite loops */
11 while (a)
12 {
13 (a->__function)();
14 a = a->__next;
15 }
16 /*
17 if (__stdio_cleanup_hook)
18 __stdio_cleanup_hook();
19 for (i=0; i<djgpp_last_dtor-djgpp_first_dtor; i++)
20 djgpp_first_dtor[i]();
21 */
22 /* in case the program set it this way */
23 _setmode(0, O_TEXT);
24 _exit(status);
25 for(;;);
26 }
27
28
29 void _exit(int _status)
30 {
31 ExitProcess(_status);
32 for(;;);
33 }
34
35 void _cexit( void )
36 {
37 // flush
38 }
39
40 void _c_exit( void )
41 {
42 // reset interup vectors
43 }