5 /****************************************************************************/
12 #define VARARGS68k __stackparm
16 #define M_DISP(n) static BOOPSI_DISPATCHER(ULONG,n,cl,obj,msg)
18 //static ULONG SAVEDS ASM n(REG(a0,struct IClass *cl),REG(a2,Object *obj),REG(a1,Msg msg))
21 #define M_DISPEND(n) BOOPSI_DISPATCHER_END
26 #define NODE(a) ((struct Node *)(a))
29 #define MINNODE(a) ((struct MinNode *)(a))
32 #define LIST(a) ((struct List *)(a))
35 #define MINLIST(a) ((struct MinList *)(a))
38 #define MESSAGE(m) ((struct Message *)(m))
41 #define NEWLIST(l) (LIST(l)->lh_Head = NODE(&LIST(l)->lh_Tail), \
42 LIST(l)->lh_Tail = NULL, \
43 LIST(l)->lh_TailPred = NODE(&LIST(l)->lh_Head))
46 #define QUICKNEWLIST(l) (LIST(l)->lh_Head = NODE(&LIST(l)->lh_Tail), \
47 LIST(l)->lh_TailPred = NODE(&LIST(l)->lh_Head))
50 #define ADDTAIL(l,n) AddTail(LIST(l),NODE(n))
53 #define PORT(p) ((struct MsgPort *)(p))
56 #define INITPORT(p,s) (PORT(p)->mp_Flags = PA_SIGNAL, \
57 PORT(p)->mp_SigBit = (UBYTE)(s), \
58 PORT(p)->mp_SigTask = FindTask(NULL), \
59 NEWLIST(&(PORT(p)->mp_MsgList)))
62 #define QUICKINITPORT(p,s,t) (PORT(p)->mp_Flags = PA_SIGNAL, \
63 PORT(p)->mp_SigBit = (UBYTE)(s), \
64 PORT(p)->mp_SigTask = (t), \
65 QUICKNEWLIST(&(PORT(p)->mp_MsgList)))
68 #define INITMESSAGE(m,p,l) (MESSAGE(m)->mn_Node.ln_Type = NT_MESSAGE, \
69 MESSAGE(m)->mn_ReplyPort = PORT(p), \
70 MESSAGE(m)->mn_Length = ((UWORD)l))
73 #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
76 #define MIN(a,b) ((a<b) ? (a) : (b))
79 #define MAX(a,b) ((a>b) ? (a) : (b))
82 #define ABS(a) (((a)>0) ? (a) : -(a))
85 #define BOOLSAME(a,b) (((a) ? TRUE : FALSE)==((b) ? TRUE : FALSE))
87 /****************************************************************************/
89 #endif /* _MACROS_H */