Files
Iain Buclaw 499c58f443 libphobos: Add module declaration to rt.invariant
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.
2025-03-22 10:55:13 +01:00

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);
}