more rendering corrections
[AROS.git] / workbench / tools / HDToolBox / arosmacros.h
blob9581759acfa169f5fa8aa359a918f7589458b4cb
1 #ifndef AROSMACROS_H
2 #define AROSMACROS_H
4 #include "compilerspecific.h"
6 #ifdef __AMIGAOS__
7 # define A0 a0
8 # define A1 a1
9 # define A2 a2
10 # define D1 d1
11 /* lib macros */
12 # define AROS_LH1(r, n, arg1, bt, bn, bo, bnb) \
13 r SAVEDS n(arg1, AROS_LHA(bt, bn, a6))
14 # define AROS_LH2(r, n, arg1, arg2, bt, bn, bo, bnb) \
15 r SAVEDS n(arg1, arg2, AROS_LHA(bt, bn, a6))
16 # define AROS_LHA(t,n,r) REGPARAM(r,t,n)
17 # define AROS_LIBFUNC_INIT
18 # define AROS_LIBFUNC_EXIT
19 /* user function macros */
20 # define AROS_UFH3S(r, n, arg1, arg2, arg3) \
21 STATIC r SAVEDS n(arg1, arg2, arg3)
22 # define AROS_UFH3(r, n, arg1, arg2, arg3) \
23 r SAVEDS n(arg1, arg2, arg3)
24 # define AROS_UFHA(t, n, r) REGPARAM(r,t,n)
25 # define AROS_USERFUNC_INIT
26 # define AROS_USERFUNC_EXIT
27 # define AROS_ASMSYMNAME(n) n
28 /* endian macros */
29 # define AROS_BE2WORD(x) x
30 # define AROS_BE2LONG(x) x
31 # define AROS_LONG2BE(x) x
32 # define AROS_WORD2BE(x) x
33 # define AROS_WORD2LE(w) ((((w) >> 8) & 0x00FF) | (((w) & 0x00FF) << 8))
34 # define AROS_LONG2LE(l) \
35 ( \
36 ((((unsigned long)(l)) >> 24) & 0x000000FFUL) | \
37 ((((unsigned long)(l)) >> 8) & 0x0000FF00UL) | \
38 ((((unsigned long)(l)) << 8) & 0x00FF0000UL) | \
39 ((((unsigned long)(l)) << 24) & 0xFF000000UL) \
41 # define AROS_LE2WORD(w) AROS_WORD2LE(w)
42 # define AROS_LE2LONG(l) AROS_LONG2LE(l)
43 /* BSTR handling */
44 # define AROS_BSTR_ADDR(s) (((STRPTR)BADDR(s))+1)
45 # define AROS_BSTR_strlen(s) (AROS_BSTR_ADDR(s)[-1])
46 # define AROS_BSTR_setstrlen(s,l) (AROS_BSTR_ADDR(s)[-1] = l)
47 # define AROS_BSTR_getchar(s,l) (AROS_BSTR_ADDR(s)[l])
48 # define AROS_BSTR_putchar(s,l,c) (AROS_BSTR_ADDR(s)[l] = c)
50 # define dn_OldName dn_Name
51 #else
52 # include <aros/macros.h>
53 # include <aros/asmcall.h>
54 #endif
56 #endif /* AROSMACROS_H */