Indentation fix, cleanup.
[AROS.git] / tools / fd2inline / makemacros.awk
blob6ddbb07005c0b10825903cd59d50b8a8296edd1c
1 #! /bin/awk -f
3 # makemacros.awk
5 # Copyright (C) 1997 Kamil Iskra <iskra@student.uci.agh.edu.pl>
6 # Distributed under terms of GNU General Public License.
8 # This file is part of fd2inline package.
10 # It is used to produce <pInline/macros.h> file.
12 BEGIN {
13 print "/* Automatically generated header! Do not edit! */"
14 print
15 print "#ifndef __INC_POS_PINLINE_MACROS_H"
16 print "#define __INC_POS_PINLINE_MACROS_H"
17 print
19 for (i=0; i<8; i++)
20 print "#define __INLINE_REG_A" i " \"a" i "\""
21 for (i=0; i<8; i++)
22 print "#define __INLINE_REG_D" i " \"d" i "\""
23 print
25 for (i=0; i<=10; i++)
27 printf "#define __INLINE_FUN_%d(__base, __lib, __offs, __type, __name", i
28 for (j=1; j<=i; j++)
29 printf ", __type%d, __name%d, __reg%d", j, j, j
30 printf ") \\\n"
32 printf "((__type (*)(void*"
33 for (j=1; j<=i; j++)
34 printf ", __type%d", j
35 printf ")) \\\n"
37 printf "*(ULONG*)(((char*)__lib)-__offs))"
39 printf "(__base"
40 for (j=1; j<=i; j++)
41 printf ", __name%d", j
42 printf ")\n\n"
45 print "#endif /* !__INC_POS_PINLINE_MACROS_H */"
46 exit