[amd64] Fix mingw-w64 build. (#4519)
[mono-project.git] / mono / utils / mono-error.h
blob88f986c509492da698af9bab26a91a6628e2d889
1 #ifndef __MONO_ERROR_H__
2 #define __MONO_ERROR_H__
4 #include <mono/utils/mono-publib.h>
6 enum {
7 /*
8 The supplied strings were dup'd by means of calling mono_error_dup_strings.
9 */
10 MONO_ERROR_FREE_STRINGS = 0x0001,
13 Something happened while processing the error and the resulting message is incomplete.
15 MONO_ERROR_INCOMPLETE = 0x0002,
17 This MonoError is heap allocated in a mempool
19 MONO_ERROR_MEMPOOL_BOXED = 0x0004
22 enum {
23 MONO_ERROR_NONE = 0,
24 MONO_ERROR_MISSING_METHOD = 1,
25 MONO_ERROR_MISSING_FIELD = 2,
26 MONO_ERROR_TYPE_LOAD = 3,
27 MONO_ERROR_FILE_NOT_FOUND = 4,
28 MONO_ERROR_BAD_IMAGE = 5,
29 MONO_ERROR_OUT_OF_MEMORY = 6,
30 MONO_ERROR_ARGUMENT = 7,
31 MONO_ERROR_ARGUMENT_NULL = 11,
32 MONO_ERROR_NOT_VERIFIABLE = 8,
33 MONO_ERROR_INVALID_PROGRAM = 12,
36 * This is a generic error mechanism is you need to raise an arbitrary corlib exception.
37 * You must pass the exception name otherwise prepare_exception will fail with internal execution.
39 MONO_ERROR_GENERIC = 9,
40 /* This one encapsulates a managed exception instance */
41 MONO_ERROR_EXCEPTION_INSTANCE = 10,
43 /* Not a valid error code - indicates that the error was cleaned up and reused */
44 MONO_ERROR_CLEANUP_CALLED_SENTINEL = 0xffff
47 /*Keep in sync with MonoErrorInternal*/
48 typedef struct _MonoError {
49 unsigned short error_code;
50 unsigned short hidden_0; /*DON'T TOUCH */
52 void *hidden_1 [12]; /*DON'T TOUCH */
53 } MonoError;
55 /* Mempool-allocated MonoError.*/
56 typedef struct _MonoErrorBoxed MonoErrorBoxed;
58 MONO_BEGIN_DECLS
60 MONO_RT_EXTERNAL_ONLY
61 MONO_API void
62 mono_error_init (MonoError *error);
64 MONO_API void
65 mono_error_init_flags (MonoError *error, unsigned short flags);
67 MONO_API void
68 mono_error_cleanup (MonoError *error);
70 MONO_API mono_bool
71 mono_error_ok (MonoError *error);
73 MONO_API unsigned short
74 mono_error_get_error_code (MonoError *error);
76 MONO_API const char*
77 mono_error_get_message (MonoError *error);
79 MONO_END_DECLS
81 #endif