diff options
Diffstat (limited to 'lib/auto/POSIX/assert.al')
-rw-r--r-- | lib/auto/POSIX/assert.al | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/auto/POSIX/assert.al b/lib/auto/POSIX/assert.al new file mode 100644 index 0000000000..f32a8537ed --- /dev/null +++ b/lib/auto/POSIX/assert.al @@ -0,0 +1,12 @@ +# NOTE: Derived from POSIX.pm. Changes made here will be lost. +package POSIX; + +sub assert { + usage "assert(expr)", caller if @_ != 1; + if (!$_[0]) { + local ($pack,$file,$line) = caller; + die "Assertion failed at $file line $line\n"; + } +} + +1; |