From 110c78b309efa4d9379ead22c639cda9b7f067b3 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 9 Jan 2012 23:27:47 +0000 Subject: [PATCH] add dereferencing macro. --- H/amiops.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/H/amiops.h b/H/amiops.h index d8abe7460..f6a8e62de 100644 --- a/H/amiops.h +++ b/H/amiops.h @@ -44,6 +44,18 @@ Dereferencing macros (D) = *(CELL *)(D); \ } while (Unsigned(A) != (D)) +#define do_derefa(D,A,LabelUnk,LabelDone) \ + (D) = *(CELL *)(A); \ + if (IsNonVarTerm(D)) goto LabelDone; \ + goto LabelUnk; \ + do { \ + (A) = (CELL *)(D); \ + (D) = *(CELL *)(D); \ + if(!IsVarTerm(D)) goto LabelDone; \ + LabelUnk: ; \ + } while (Unsigned(A) != (D));\ + LabelDone: + #define derefa_body(D,A,LabelUnk,LabelNonVar) \ do { \ (A) = (CELL *)(D); \