branch update for HEAD-2003021201
[reactos.git] / lib / msvcrt / misc / amsg.c
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS system libraries
4  * FILE:        lib/msvcrt/misc/amsg.c
5  * PURPOSE:     Print runtime error messages
6  * PROGRAMER:   Boudewijn Dekker
7  * UPDATE HISTORY:
8  *              28/12/98: Created
9  */
10
11 #include <msvcrt/stdlib.h>
12 #include <msvcrt/stdio.h>
13
14
15 static char *__rt_err_msg[] =
16 {
17    "stack overflow",                            /* _RT_STACK */
18    "null pointer assignment",                   /* _RT_NULLPTR */
19    "floating point not loaded",                 /* _RT_FLOAT */
20    "integer divide by 0",                       /* _RT_INTDIV */
21    "not enough space for arguments",            /* _RT_SPACEARG */
22    "not enough space for environment",          /* _RT_SPACEENV */
23    "abnormal program termination",              /* _RT_ABORT */
24    "not enough space for thread data",          /* _RT_THREAD */
25    "unexpected multithread lock error",         /* _RT_LOCK */
26    "unexpected heap error",                     /* _RT_HEAP */
27    "unable to open console device",             /* _RT_OPENCON */
28    "non-continuable exception",                 /* _RT_NONCONT */
29    "invalid exception disposition",             /* _RT_INVALDISP */
30    "not enough space for _onexit/atexit table", /* _RT_ONEXIT */
31    "pure virtual function call",                /* _RT_PUREVIRT */
32    "not enough space for stdio initialization", /* _RT_STDIOINIT */
33    "not enough space for lowio initialization", /* _RT_LOWIOINIT */
34 };
35
36
37 int _aexit_rtn(int exitcode)
38 {
39     _exit(exitcode);
40     return 0;
41 }
42
43 void _amsg_exit(int errnum)
44 {
45     fprintf(stderr, "runtime error - %s\n", __rt_err_msg[errnum]);
46     _aexit_rtn(-1);
47 }
48