1 // [AsmJit]
2 // Complete JIT Assembler for C++ Language.
3 //
4 // [License]
5 // Zlib - See COPYING file in this package.
6 
7 #define ASMJIT_EXPORTS
8 
9 // [Dependencies - AsmJit]
10 #include "../core/defs.h"
11 
12 // [Api-Begin]
13 #include "../core/apibegin.h"
14 
15 namespace AsmJit {
16 
17 // ============================================================================
18 // [AsmJit::getErrorString]
19 // ============================================================================
20 
getErrorString(uint32_t error)21 const char* getErrorString(uint32_t error)
22 {
23   static const char* errorMessage[] = {
24     "No error",
25 
26     "No heap memory",
27     "No virtual memory",
28 
29     "Unknown instruction",
30     "Illegal instruction",
31     "Illegal addressing",
32     "Illegal short jump",
33 
34     "No function defined",
35     "Incomplete function",
36 
37     "Not enough registers",
38     "Registers overlap",
39 
40     "Incompatible argument",
41     "Incompatible return value",
42 
43     "Unknown error"
44   };
45 
46   // Saturate error code to be able to use errorMessage[].
47   if (error > kErrorCount)
48     error = kErrorCount;
49 
50   return errorMessage[error];
51 }
52 
53 } // AsmJit
54 
55 // [Api-End]
56 #include "../core/apiend.h"
57