mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-05 22:43:13 +01:00
merge
This commit is contained in:
25
runtime/internal/invariant.d
Normal file
25
runtime/internal/invariant.d
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
/*
|
||||
* Placed into the Public Domain
|
||||
* written by Walter Bright
|
||||
* www.digitalmars.com
|
||||
*/
|
||||
|
||||
extern(C) void _d_invariant(Object o)
|
||||
{ ClassInfo c;
|
||||
|
||||
//printf("__d_invariant(%p)\n", o);
|
||||
|
||||
// BUG: needs to be filename/line of caller, not library routine
|
||||
assert(o !is null); // just do null check, not invariant check
|
||||
|
||||
c = o.classinfo;
|
||||
do
|
||||
{
|
||||
if (c.classInvariant)
|
||||
{
|
||||
(*c.classInvariant)(o);
|
||||
}
|
||||
c = c.base;
|
||||
} while (c);
|
||||
}
|
||||
@@ -83,6 +83,7 @@ OBJ_BASE= \
|
||||
memory.bc \
|
||||
qsort2.bc \
|
||||
switch.bc \
|
||||
invariant.bc \
|
||||
|
||||
OBJ_UTIL= \
|
||||
util/console.bc \
|
||||
|
||||
Reference in New Issue
Block a user