Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / libs / openurl / include / aros / macros.h
blob889b55fe5ebb499282f095c1311d65e3659a50e8
2 #ifndef _MACROS_H
3 #define _MACROS_H
5 /****************************************************************************/
7 #define SAVEDS
8 #define ASM
9 #define REGARGS
10 #define STDARGS
11 #define INLINE inline
12 #define VARARGS68k __stackparm
13 #define REG(x,p) p
14 //#define LIBCALL
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))
20 #define M_DISPSTART
21 #define M_DISPEND(n) BOOPSI_DISPATCHER_END
22 #define DISP(n) (n)
25 #undef NODE
26 #define NODE(a) ((struct Node *)(a))
28 #undef MINNODE
29 #define MINNODE(a) ((struct MinNode *)(a))
31 #undef LIST
32 #define LIST(a) ((struct List *)(a))
34 #undef MINLIST
35 #define MINLIST(a) ((struct MinList *)(a))
37 #undef MESSAGE
38 #define MESSAGE(m) ((struct Message *)(m))
40 #undef NEWLIST
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))
45 #undef QUICKNEWLIST
46 #define QUICKNEWLIST(l) (LIST(l)->lh_Head = NODE(&LIST(l)->lh_Tail), \
47 LIST(l)->lh_TailPred = NODE(&LIST(l)->lh_Head))
49 #undef ADDTAIL
50 #define ADDTAIL(l,n) AddTail(LIST(l),NODE(n))
52 #undef PORT
53 #define PORT(p) ((struct MsgPort *)(p))
55 #undef INITPORT
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)))
61 #undef QUICKINITPORT
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)))
67 #undef INITMESSAGE
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))
72 #undef MAKE_ID
73 #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
75 #undef MIN
76 #define MIN(a,b) ((a<b) ? (a) : (b))
78 #undef MAX
79 #define MAX(a,b) ((a>b) ? (a) : (b))
81 #undef ABS
82 #define ABS(a) (((a)>0) ? (a) : -(a))
84 #undef BOOLSAME
85 #define BOOLSAME(a,b) (((a) ? TRUE : FALSE)==((b) ? TRUE : FALSE))
87 /****************************************************************************/
89 #endif /* _MACROS_H */