assert.c (8a4599117ba1537d77e66475f83944995f85e437) | assert.c (6cefb54a32297dc02286e02a646ec3da1d902ecd) |
---|---|
1/*- 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 | 1/*- 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 |
34#if 0 |
|
34#if defined(LIBC_SCCS) && !defined(lint) 35static char sccsid[] = "@(#)assert.c 8.1 (Berkeley) 6/4/93"; 36#endif /* LIBC_SCCS and not lint */ | 35#if defined(LIBC_SCCS) && !defined(lint) 36static char sccsid[] = "@(#)assert.c 8.1 (Berkeley) 6/4/93"; 37#endif /* LIBC_SCCS and not lint */ |
38#endif |
|
37 | 39 |
40#include <sys/cdefs.h> 41__FBSDID("$FreeBSD$"); 42 |
|
38#include <assert.h> 39#include <stdio.h> 40#include <stdlib.h> 41 42void | 43#include <assert.h> 44#include <stdio.h> 45#include <stdlib.h> 46 47void |
43__assert(file, line, failedexpr) 44 const char *file, *failedexpr; 45 int line; | 48__assert(function, file, line, failedexpr) 49 const char *failedexpr, *file, *function; 50 int line; |
46{ 47 (void)fprintf(stderr, | 51{ 52 (void)fprintf(stderr, |
48 "assertion \"%s\" failed: file \"%s\", line %d\n", 49 failedexpr, file, line); | 53 "assertion (%s) failed: function %s(), file %s:%d\n", 54 failedexpr, function, file, line); |
50 abort(); 51 /* NOTREACHED */ 52} | 55 abort(); 56 /* NOTREACHED */ 57} |