NetSurf
assert.c
Go to the documentation of this file.
1/*
2 * Copyright 2005 James Bursa <bursa@users.sourceforge.net>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/** \file
20 * Assert reporting (RISC OS implementation).
21 */
22
23#include <assert.h>
24#include <stdio.h>
25#include <stdlib.h>
26#include "oslib/wimp.h"
27
28
29/**
30 * Report an assert() failure and exit.
31 */
32
33void __assert2(const char *expr, const char *function, const char *file,
34 int line)
35{
36 fprintf(stderr, "\n\"%s\", line %d: %s%sAssertion failed: %s\n",
37 file, line,
38 function ? function : "",
39 function ? ": " : "",
40 expr);
41 fflush(stderr);
42
43 abort();
44}
void __assert2(const char *expr, const char *function, const char *file, int line)
Report an assert() failure and exit.
Definition: assert.c:33
static nserror line(const struct redraw_context *ctx, const plot_style_t *style, const struct rect *line)
Plots a line.
Definition: plot.c:579