ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/libcpjit/cpjit.h.PL
(Generate patch)

Comparing cvsroot/libcpjit/cpjit.h.PL (file contents):
Revision 1.1 by root, Tue Oct 11 19:59:16 2005 UTC vs.
Revision 1.2 by root, Tue Oct 11 20:18:18 2005 UTC

5open STDOUT, ">cpjit.h" 5open STDOUT, ">cpjit.h"
6 or die "cpijit.h: $!"; 6 or die "cpijit.h: $!";
7 7
8print <<EOF; 8print <<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
30namespace cpjit 33namespace 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
45EOF 62EOF
46 63
47print <<EOF; 64print <<EOF;
48} 65}
49EOF 66EOF

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines