shithub: mc

ref: 0eae465b2ba82f8a0e49c869bddd37b85ec2e5ae
dir: /lib/std/assert.myr/

View raw version
use "fmt"
use "syswrap"
use "varargs"

pkg std =
	const assert	: (cond : bool, fmt : byte[:], args : ... -> void)
;;

const assert = {cond, msg, args
	var ap

	ap = vastart(&args)
	if !cond
		std.fputv(2, msg, &ap)
		suicide()
	;;
}