nlr.h: Do proper arch selection, using the same tests as nlr*.S .

This commit is contained in:
Paul Sokolovsky 2014-02-27 18:01:43 +02:00
parent 793838a919
commit 82a165d9be
1 changed files with 5 additions and 9 deletions

View File

@ -3,23 +3,19 @@
#include <limits.h> #include <limits.h>
//#ifndef __WORDSIZE
//#error __WORDSIZE needs to be defined
//#endif
typedef struct _nlr_buf_t nlr_buf_t; typedef struct _nlr_buf_t nlr_buf_t;
struct _nlr_buf_t { struct _nlr_buf_t {
// the entries here must all be machine word size // the entries here must all be machine word size
nlr_buf_t *prev; nlr_buf_t *prev;
void *ret_val; void *ret_val;
#if __WORDSIZE == 32 #if defined(__i386__)
void *regs[6]; void *regs[6];
#elif __WORDSIZE == 64 #elif defined(__x86_64__)
void *regs[8]; void *regs[8];
#else #elif defined(__thumb2__)
// hack for thumb
void *regs[10]; void *regs[10];
//#error Unsupported __WORDSIZE #else
#error Unknown arch in nlr.h
#endif #endif
}; };