summaryrefslogtreecommitdiff
path: root/lib/std/assert.myr
blob: 1a14186b6bb4b5c616009ceb8e9e28a92abc7fe6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use "fmt"
use "syswrap"
use "varargs"

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

const assert = {cond, msg, args
	var ap

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