Skip to content

Commit 82a165d

Browse files
committed
nlr.h: Do proper arch selection, using the same tests as nlr*.S .
1 parent 793838a commit 82a165d

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

py/nlr.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,19 @@
33

44
#include <limits.h>
55

6-
//#ifndef __WORDSIZE
7-
//#error __WORDSIZE needs to be defined
8-
//#endif
9-
106
typedef struct _nlr_buf_t nlr_buf_t;
117
struct _nlr_buf_t {
128
// the entries here must all be machine word size
139
nlr_buf_t *prev;
1410
void *ret_val;
15-
#if __WORDSIZE == 32
11+
#if defined(__i386__)
1612
void *regs[6];
17-
#elif __WORDSIZE == 64
13+
#elif defined(__x86_64__)
1814
void *regs[8];
19-
#else
20-
// hack for thumb
15+
#elif defined(__thumb2__)
2116
void *regs[10];
22-
//#error Unsupported __WORDSIZE
17+
#else
18+
#error Unknown arch in nlr.h
2319
#endif
2420
};
2521

0 commit comments

Comments
 (0)