mirror of
https://github.com/openRuyi-Project/gcc.git
synced 2026-09-06 14:01:37 +00:00
This prevents conflicts with a user-provided `invariant.d' module. gcc/d/ChangeLog: * runtime.def (INVARIANT): Update signature of run-time function. libphobos/ChangeLog: * libdruntime/Makefile.am (DRUNTIME_DSOURCES): Rename rt/invariant.d to rt/invariant_.d. * libdruntime/Makefile.in: Regenerate. * libdruntime/rt/invariant.d: Move to... * libdruntime/rt/invariant_.d: ...here.
33 lines
669 B
D
33 lines
669 B
D
/**
|
|
* Implementation of invariant support routines.
|
|
*
|
|
* Copyright: Copyright Digital Mars 2007 - 2010.
|
|
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
|
|
* Authors: Walter Bright
|
|
* Source: $(DRUNTIMESRC rt/_invariant_.d)
|
|
*/
|
|
|
|
module rt.invariant_;
|
|
|
|
/**
|
|
*
|
|
*/
|
|
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 = typeid(o);
|
|
do
|
|
{
|
|
if (c.classInvariant)
|
|
{
|
|
(*c.classInvariant)(o);
|
|
}
|
|
c = c.base;
|
|
} while (c);
|
|
}
|