comparison lphobos/internal/contract.d @ 473:373489eeaf90

Applied downs' lphobos update
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Mon, 04 Aug 2008 19:28:49 +0200
parents 61615fa85940
children
comparison
equal deleted inserted replaced
472:15c804b6ce77 473:373489eeaf90
1 module internal.contract; 1 module internal.contract;
2 2
3 import std.string: toString;
3 extern(C): 4 extern(C):
4 5
5 void exit(int); 6 void exit(int);
6 7
7 void _d_assert(bool cond, uint line, char[] msg) 8 /*void _d_assert(bool cond, uint line, char[] msg)
8 { 9 {
9 if (!cond) { 10 if (!cond) {
10 printf("Aborted(%u): %.*s\n", line, msg.length, msg.ptr); 11 printf("Aborted(%u): %.*s\n", line, msg.length, msg.ptr);
11 exit(1); 12 exit(1);
12 } 13 }
14 }*/
15 void _d_assert(string file, uint line) {
16 throw new Exception(file~":"~.toString(line)~": Assertion failed!");
13 } 17 }
18
19 void _d_assert_msg(string msg, string file, uint line) {
20 throw new Exception(file~": "~.toString(line)~": Assertion failed: \""~msg~"\"");
21 }