forked from mirrors/0ad
Executable version of the exception-stuff generator
This was SVN commit r1060.
This commit is contained in:
Executable
BIN
Binary file not shown.
+7
-5
@@ -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...
|
||||
}
|
||||
.
|
||||
|
||||
|
||||
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user