4 ** $VER: BoopsiStubs.h 1.2 (1.9.97)
6 ** Copyright (C) 1997 Bernardo Innocenti. All rights reserved.
8 ** Use 4 chars wide TABs to read this file
10 ** Using these inline versions of the amiga.lib boopsi support functions
11 ** results in faster and smaller code against their linked library
12 ** counterparts. When debug is active, this function also validate the
13 ** parameters you pass in.
17 #ifndef COMPILERSPECIFIC_H
18 #include "CompilerSpecific.h"
19 #endif /* COMPILERSPECIFIC_H */
26 /* the _HookPtr type is a shortcut for a pointer to a hook function */
28 typedef ASMCALL
ULONG (*_HookPtr
)
29 (REG(a0
, Class
*), REG(a2
, Object
*), REG(a1
, APTR
));
31 INLINE ULONG
CoerceMethodA (struct IClass
*cl
, Object
*o
, Msg message
)
36 return ((_HookPtr
)cl
->cl_Dispatcher
.h_Entry
) ((APTR
)cl
, (APTR
)o
, (APTR
)message
);
39 INLINE ULONG
DoSuperMethodA (struct IClass
*cl
, Object
*o
, Msg message
)
45 return ((_HookPtr
)cl
->cl_Dispatcher
.h_Entry
) ((APTR
)cl
, (APTR
)o
, (APTR
)message
);
48 INLINE ULONG
DoMethodA (Object
*o
, Msg message
)
55 return ((_HookPtr
)cl
->cl_Dispatcher
.h_Entry
) ((APTR
)cl
, (APTR
)o
, (APTR
)message
);
59 #define CoerceMethod(cl, o, msg...) \
61 ULONG _msg[] = { msg }; \
64 ((_HookPtr)cl->cl_Dispatcher.h_Entry) ((APTR)cl, (APTR)o, (APTR)_msg); \
67 #define DoSuperMethod(cl, o, msg...) \
70 ULONG _msg[] = { msg }; \
73 _cl = cl = cl->cl_Super; \
74 ASSERT_VALIDNO0(_cl) \
75 ((_HookPtr)_cl->cl_Dispatcher.h_Entry) ((APTR)_cl, (APTR)o, (APTR)_msg); \
78 #define DoMethod(o, msg...) \
81 ULONG _msg[] = { msg }; \
84 ASSERT_VALIDNO0(_cl) \
85 ((_HookPtr)_cl->cl_Dispatcher.h_Entry) ((APTR)_cl, (APTR)o, (APTR)_msg); \
88 /* Var-args stub for the OM_NOTIFY method */
89 #define NotifyAttrs(o, gi, flags, attrs...) \
92 ULONG _attrs[] = { attrs }; \
93 ULONG _msg[] = { OM_NOTIFY, (ULONG)_attrs, (ULONG)gi, flags }; \
96 ASSERT_VALIDNO0(_cl) \
98 ((_HookPtr)_cl->cl_Dispatcher.h_Entry) ((APTR)_cl, (APTR)o, (APTR)_msg); \
101 /* Var-args stub for the OM_UPDATE method */
102 #define UpdateAttrs(o, gi, flags, attrs...) \
105 ULONG _attrs[] = { attrs }; \
106 ULONG _msg[] = { OM_UPDATE, (ULONG)_attrs, (ULONG)gi, flags }; \
109 ASSERT_VALIDNO0(_cl) \
111 ((_HookPtr)_cl->cl_Dispatcher.h_Entry) ((APTR)_cl, (APTR)o, (APTR)_msg); \
114 /* Nobody else needs this anymore... */
117 #endif /* !BOOPSISTUBS_H */