|
36 | 36 |
|
37 | 37 | // If MICROPY_NLR_SETJMP is not enabled then auto-detect the machine arch |
38 | 38 | #if !defined(MICROPY_NLR_SETJMP) || !MICROPY_NLR_SETJMP |
39 | | -#define MICROPY_NLR_SETJMP (0) |
40 | 39 | // A lot of nlr-related things need different treatment on Windows |
41 | | -#if defined(_WIN32) || defined(__CYGWIN__) |
42 | | -#define MICROPY_NLR_OS_WINDOWS 1 |
43 | | -#else |
44 | | -#define MICROPY_NLR_OS_WINDOWS 0 |
45 | | -#endif |
46 | | -#if defined(__i386__) |
47 | | - #define MICROPY_NLR_X86 (1) |
48 | | - #define MICROPY_NLR_NUM_REGS (6) |
49 | | -#elif defined(__x86_64__) |
50 | | - #define MICROPY_NLR_X64 (1) |
51 | | - #if MICROPY_NLR_OS_WINDOWS |
52 | | - #define MICROPY_NLR_NUM_REGS (10) |
| 40 | + #if defined(_WIN32) || defined(__CYGWIN__) |
| 41 | + #define MICROPY_NLR_OS_WINDOWS 1 |
53 | 42 | #else |
54 | | - #define MICROPY_NLR_NUM_REGS (8) |
| 43 | + #define MICROPY_NLR_OS_WINDOWS 0 |
55 | 44 | #endif |
56 | | -#elif defined(__thumb2__) || defined(__thumb__) || defined(__arm__) |
57 | | - #define MICROPY_NLR_THUMB (1) |
58 | | - #define MICROPY_NLR_NUM_REGS (10) |
59 | | -#elif defined(__xtensa__) |
60 | | - #define MICROPY_NLR_XTENSA (1) |
61 | | - #define MICROPY_NLR_NUM_REGS (10) |
62 | | -#else |
63 | | - #define MICROPY_NLR_SETJMP (1) |
| 45 | + #if defined(__i386__) |
| 46 | + #define MICROPY_NLR_X86 (1) |
| 47 | + #define MICROPY_NLR_NUM_REGS (6) |
| 48 | + #elif defined(__x86_64__) |
| 49 | + #define MICROPY_NLR_X64 (1) |
| 50 | + #if MICROPY_NLR_OS_WINDOWS |
| 51 | + #define MICROPY_NLR_NUM_REGS (10) |
| 52 | + #else |
| 53 | + #define MICROPY_NLR_NUM_REGS (8) |
| 54 | + #endif |
| 55 | + #elif defined(__thumb2__) || defined(__thumb__) || defined(__arm__) |
| 56 | + #define MICROPY_NLR_THUMB (1) |
| 57 | + #define MICROPY_NLR_NUM_REGS (10) |
| 58 | + #elif defined(__xtensa__) |
| 59 | + #define MICROPY_NLR_XTENSA (1) |
| 60 | + #define MICROPY_NLR_NUM_REGS (10) |
| 61 | + #else |
| 62 | + #define MICROPY_NLR_SETJMP (1) |
64 | 63 | //#warning "No native NLR support for this arch, using setjmp implementation" |
| 64 | + #endif |
65 | 65 | #endif |
| 66 | + |
| 67 | +// If MICROPY_NLR_SETJMP is not defined above - define/disable it here |
| 68 | + |
| 69 | +#if !defined(MICROPY_NLR_SETJMP) |
| 70 | + #define MICROPY_NLR_SETJMP (0) |
66 | 71 | #endif |
67 | 72 |
|
68 | 73 | #if MICROPY_NLR_SETJMP |
|
0 commit comments