… | |
… | |
5 | open STDOUT, ">cpjit.h" |
5 | open STDOUT, ">cpjit.h" |
6 | or die "cpijit.h: $!"; |
6 | or die "cpijit.h: $!"; |
7 | |
7 | |
8 | print <<EOF; |
8 | print <<EOF; |
9 | /* |
9 | /* |
|
|
10 | This file is AUTOMAGICALLY created by cpjit.h.PL. Modifications will |
|
|
11 | be lost. |
|
|
12 | |
10 | cpjit.h -- c portable jit in time compiler |
13 | cpjit.h -- c portable jit in time compiler |
11 | Copyright (C) 2005 Marc Lehmann <cpjit@schmorp.de> |
14 | Copyright (C) 2005 Marc Lehmann <cpjit@schmorp.de> |
12 | |
15 | |
13 | This file is part of libcpjit. |
16 | This file is part of libcpjit. |
14 | |
17 | |
… | |
… | |
28 | */ |
31 | */ |
29 | |
32 | |
30 | namespace cpjit |
33 | namespace cpjit |
31 | { |
34 | { |
32 | |
35 | |
33 | // environment for persistent or temporary storage |
36 | // environment for persistent or temporary storage |
34 | class env |
37 | struct env |
35 | { |
38 | { |
36 | }; |
39 | }; |
37 | |
40 | |
38 | class func_base |
41 | struct func_base |
39 | { |
42 | { |
40 | }; |
43 | }; |
41 | |
44 | |
42 | class funcbuilder_base |
45 | struct funcbuilder_base |
43 | { |
46 | { |
44 | }; |
47 | }; |
|
|
48 | |
|
|
49 | template<typename R, typename A1> |
|
|
50 | struct function : func_base |
|
|
51 | { |
|
|
52 | function (env &e, id i) |
|
|
53 | : func_base (e, i, typestr<typename R>) |
|
|
54 | { |
|
|
55 | typename R |
|
|
56 | operator ()(A1 a1) |
|
|
57 | { |
|
|
58 | return ((typename R (*)(A1 a1)) ptr ())(a1); |
|
|
59 | } |
|
|
60 | }; |
|
|
61 | |
45 | EOF |
62 | EOF |
46 | |
63 | |
47 | print <<EOF; |
64 | print <<EOF; |
48 | } |
65 | } |
49 | EOF |
66 | EOF |