1
0
forked from mirrors/0ad

Executable version of the exception-stuff generator

This was SVN commit r1060.
This commit is contained in:
Ykkrosh
2004-08-26 10:34:09 +00:00
parent 4041b7880e
commit 9c579eb89d
3 changed files with 7 additions and 5 deletions
BIN
View File
Binary file not shown.
+7 -5
View File
@@ -160,28 +160,30 @@ const wchar_t* GetErrorString(PSRETURN code)
for (sort keys %types) {
(my $name = $_) =~ s/~/_/;
print $out qq{\tcase 0x}.unpack('H*',$types{$_}).qq{: return L"$name"; break;\n};
print $out qq{\tcase 0x}.unpack('H*',$types{$_}).qq{: return L"$name";\n};
}
print $out <<".";
\tdefault: return L"Unrecognised error";
\t}
\treturn L"Unrecognised error";
}
void ThrowError(PSRETURN code)
{
\tswitch (code)
\tswitch (code) // Use 'break' in case someone tries to continue from the exception
\t{
.
for (sort keys %types) {
(my $name = $_) =~ s/~/_/;
print $out qq{\tcase 0x}.unpack('H*',$types{$_}).qq{: throw PSERROR_$name();\n};
print $out qq{\tcase 0x}.unpack('H*',$types{$_}).qq{: throw PSERROR_$name(); break;\n};
}
print $out <<".";
\tdefault: throw PSERROR_Error_InvalidError(); // Hmm...
\t}
\tthrow PSERROR_Error_InvalidError(); // Hmm...
}
.
BIN
View File
Binary file not shown.