| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef _SRC_SUPPORT_H |
| 6 |
#define _SRC_SUPPORT_H |
| 7 |
|
| 8 |
#define RUNNING_ON_LLINTERP 0 |
| 9 |
#define OP_JIT_RECORD_EXACT_CLASS(i, c, r) |
| 10 |
#define OP_JIT_RECORD_EXACT_VALUE(i, c, r) |
| 11 |
#define OP_JIT_RECORD_KNOWN_RESULT(r, f, ...) |
| 12 |
|
| 13 |
#define FAIL_OVF(msg) _RPyRaiseSimpleException(RPyExc_OverflowError) |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
#ifdef RPY_ASSERT |
| 30 |
# define RPyAssert(x, msg) \ |
| 31 |
if (!(x)) RPyAssertFailed(__FILE__, __LINE__, __FUNCTION__, msg) |
| 32 |
|
| 33 |
RPY_EXTERN |
| 34 |
void RPyAssertFailed(const char* filename, long lineno, |
| 35 |
const char* function, const char *msg); |
| 36 |
#else |
| 37 |
# define RPyAssert(x, msg) |
| 38 |
#endif |
| 39 |
|
| 40 |
RPY_EXTERN |
| 41 |
void RPyAbort(void); |
| 42 |
|
| 43 |
RPY_EXTERN |
| 44 |
double _PyPy_dg_stdnan(int sign); |
| 45 |
|
| 46 |
#if defined(RPY_LL_ASSERT) || defined(RPY_SANDBOXED) |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
# define RPyCHECK(x) ((x)?(void)0:RPyAbort()) |
| 55 |
# define RPyField(ptr, name) ((RPyCHECK(ptr), (ptr))->name) |
| 56 |
# define RPyItem(array, index) \ |
| 57 |
((RPyCHECK((index) >= 0 && (index) < (array)->length), \ |
| 58 |
(array))->items[index]) |
| 59 |
# define RPyFxItem(ptr, index, fixedsize) \ |
| 60 |
((RPyCHECK((ptr) != NULL && (index) >= 0 && (index) < (fixedsize)), \ |
| 61 |
(ptr))[index]) |
| 62 |
# define RPyNLenItem(array, index) \ |
| 63 |
((RPyCHECK((array) != NULL && (index) >= 0), (array))->items[index]) |
| 64 |
# define RPyBareItem(array, index) \ |
| 65 |
((RPyCHECK((array) != NULL && (index) >= 0), (array))[index]) |
| 66 |
|
| 67 |
#else |
| 68 |
# define RPyField(ptr, name) ((ptr)->name) |
| 69 |
# define RPyItem(array, index) ((array)->items[index]) |
| 70 |
# define RPyFxItem(ptr, index, fixedsize) ((ptr)[index]) |
| 71 |
# define RPyNLenItem(array, index) ((array)->items[index]) |
| 72 |
# define RPyBareItem(array, index) ((array)[index]) |
| 73 |
#endif |
| 74 |
|
| 75 |
#endif |