ca35cc2f416dff223508e292afbcb83184626788
[openafs.git] / src / util / assert.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /* ReallyAbort:  called from assert. May/85 */
11 #include <afsconfig.h>
12 #include <afs/param.h>
13 #include <stdlib.h>
14
15 RCSID("$Header$");
16
17 #include <stdio.h>
18
19 #ifdef AFS_NT40_ENV
20 void afs_NTAbort(void)
21 {
22     _asm int 3h; /* always trap. */
23 }
24 #endif
25
26
27 void AssertionFailed(char *file, int line)
28 {
29     fprintf(stderr, "Assertion failed! file %s, line %d.\n", file, line);
30     fflush(stderr);
31 #ifdef AFS_NT40_ENV
32     afs_NTAbort();
33 #else
34     abort();
35 #endif
36 }
37