Mercurial > projects > ldc
annotate lphobos/internal/contract.d @ 1351:8d501abecd24
Initial (but disabled) fix for ticket #294 , the actual part that fixes the bug is in a #if 0 block as I'm afraid it will cause regressions. I'm most likely not going to be around tonight, and maybe not tomorrow as well, so I'm pushing it in case someone wants to run some serious testing/investigate the problem noted in llvmhelpers.cpp : realignOffset .
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Thu, 14 May 2009 17:20:17 +0200 |
parents | 373489eeaf90 |
children |
rev | line source |
---|---|
1 | 1 module internal.contract; |
2 | |
473
373489eeaf90
Applied downs' lphobos update
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
94
diff
changeset
|
3 import std.string: toString; |
1 | 4 extern(C): |
5 | |
6 void exit(int); | |
7 | |
473
373489eeaf90
Applied downs' lphobos update
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
94
diff
changeset
|
8 /*void _d_assert(bool cond, uint line, char[] msg) |
1 | 9 { |
10 if (!cond) { | |
94
61615fa85940
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
lindquist
parents:
1
diff
changeset
|
11 printf("Aborted(%u): %.*s\n", line, msg.length, msg.ptr); |
1 | 12 exit(1); |
13 } | |
473
373489eeaf90
Applied downs' lphobos update
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
94
diff
changeset
|
14 }*/ |
373489eeaf90
Applied downs' lphobos update
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
94
diff
changeset
|
15 void _d_assert(string file, uint line) { |
373489eeaf90
Applied downs' lphobos update
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
94
diff
changeset
|
16 throw new Exception(file~":"~.toString(line)~": Assertion failed!"); |
1 | 17 } |
473
373489eeaf90
Applied downs' lphobos update
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
94
diff
changeset
|
18 |
373489eeaf90
Applied downs' lphobos update
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
94
diff
changeset
|
19 void _d_assert_msg(string msg, string file, uint line) { |
373489eeaf90
Applied downs' lphobos update
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
94
diff
changeset
|
20 throw new Exception(file~": "~.toString(line)~": Assertion failed: \""~msg~"\""); |
373489eeaf90
Applied downs' lphobos update
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
94
diff
changeset
|
21 } |