mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 19:03:13 +01:00
22 lines
506 B
D
22 lines
506 B
D
module internal.contract;
|
|
|
|
import std.string: toString;
|
|
extern(C):
|
|
|
|
void exit(int);
|
|
|
|
/*void _d_assert(bool cond, uint line, char[] msg)
|
|
{
|
|
if (!cond) {
|
|
printf("Aborted(%u): %.*s\n", line, msg.length, msg.ptr);
|
|
exit(1);
|
|
}
|
|
}*/
|
|
void _d_assert(string file, uint line) {
|
|
throw new Exception(file~":"~.toString(line)~": Assertion failed!");
|
|
}
|
|
|
|
void _d_assert_msg(string msg, string file, uint line) {
|
|
throw new Exception(file~": "~.toString(line)~": Assertion failed: \""~msg~"\"");
|
|
}
|