Last change
on this file since 1158 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 |
|
---|
7 | function 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 |
|
---|
17 | END {
|
---|
18 | if (_assert_exit)
|
---|
19 | exit 1
|
---|
20 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.