-#ifdef GHCI
-
-#define CHASE_INDIRECTIONS(lval) \
- do { \
- int again; \
- do { \
- again = 0; \
- if (get_itbl((StgClosure*)lval)->type == IND) \
- { again = 1; lval = ((StgInd*)lval)->indirectee; } \
- else \
- if (get_itbl((StgClosure*)lval)->type == IND_OLDGEN) \
- { again = 1; lval = ((StgIndOldGen*)lval)->indirectee; } \
- } while (again); \
- } while (0)
-
-#define indexWordOffClosurezh(r,a,i) \
- do { StgClosure* tmp = (StgClosure*)(a); \
- CHASE_INDIRECTIONS(tmp); \
- r = ((P_)tmp)[i]; \
- } while (0)
-
-#define indexDoubleOffClosurezh(r,a,i) \
- do { StgClosure* tmp = (StgClosure*)(a); \
- CHASE_INDIRECTIONS(tmp); \
- r = PK_DBL(((P_)tmp + i); \
- } while (0)
-
-#define indexPtrOffClosurezh(r,a,i) \
- do { StgClosure* tmp = (StgClosure*)(a); \
- CHASE_INDIRECTIONS(tmp); \
- r = ((P_ *)tmp)[i]; \
- } while (0) \
-
-#define setWordOffClosurezh(r,a,i,b) \
- do { StgClosure* tmp = (StgClosure*)(a); \
- CHASE_INDIRECTIONS(tmp); \
- ((P_)tmp)[i] = b; \
- r = (P_)tmp; \
- } while (0)
-
-#define setDoubleOffClosurezh(r,a,i,b) \
- do { StgClosure* tmp = (StgClosure*)(a); \
- CHASE_INDIRECTIONS(tmp); \
- ASSIGN_DBL((P_)tmp + i, b); \
- r = (P_)tmp; \
- } while (0)
-
-#define setPtrOffClosurezh(r,a,i,b) \
- do { StgClosure* tmp = (StgClosure*)(a); \
- CHASE_INDIRECTIONS(tmp); \
- ((P_ *)tmp)[i] = b; \
- r = (P_)tmp; \
- } while (0)