source: Daodan/MinGW/msys/1.0/share/awk/assert.awk@ 1095

Last change on this file since 1095 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 382 bytes
Line 
1# assert --- assert that a condition is true. Otherwise exit.
2
3#
4# Arnold Robbins, arnold@skeeve.com, Public Domain
5# May, 1993
6
7function assert(condition, string)
8{
9 if (! condition) {
10 printf("%s:%d: assertion failed: %s\n",
11 FILENAME, FNR, string) > "/dev/stderr"
12 _assert_exit = 1
13 exit 1
14 }
15}
16
17END {
18 if (_assert_exit)
19 exit 1
20}
Note: See TracBrowser for help on using the repository browser.