3 # Copyright (c) 1999 Avi Kivity
4 # instmac.pl -- generate template instantiations
5 # derived from James Clark's instmac.m4
15 namespace SP_NAMESPACE {
28 print <<__INSTANTIATION__;
30 #pragma define_template $class
33 #pragma define($class)
35 #ifdef SP_ANSI_CLASS_INST
36 template class $class;
38 typedef $class Dummy_$index;
48 my ($a1, $a2, $a3, $a4) = @_;
49 print <<__FUNC_INSTANTIATION__;
51 template void $a1($a2, $a3, $a4);
54 void func_$func_index ($a2 arg1, $a3 arg2, $a4 arg3) {
55 (void)$a1(arg1, arg2, arg3);
58 __FUNC_INSTANTIATION__
65 if (/^__instantiate\((.*)\)\s*$/)
68 $arg = $1 if /`(.*)'/;
71 elsif (/^__instantiate\((.*)\)\s*$/)
73 die "instantiate_func3 found!";