diff options
-rw-r--r-- | !NetSurf/!Run,feb | 4 | ||||
-rw-r--r-- | makefile | 2 | ||||
-rw-r--r-- | riscos/assert.c | 46 |
3 files changed, 49 insertions, 3 deletions
diff --git a/!NetSurf/!Run,feb b/!NetSurf/!Run,feb index 0ba446172..cc03f1fb4 100644 --- a/!NetSurf/!Run,feb +++ b/!NetSurf/!Run,feb @@ -1,4 +1,4 @@ -| Run file for NetSurf. ( $Revision: 1.41 $ ) +| Run file for NetSurf. ( $Revision: 1.42 $ ) | | This file ensures that the system resources required by NetSurf are | present. Additionally, it forces setting of system variables related @@ -77,4 +77,4 @@ Unset NetSurf$SpecialFX Unset Alias$NetSurfRMLoad WimpSlot -min 2240k -max 2240k -Run <NetSurf$Dir>.!RunImage %*0 2><NetSurf$Dir>.stderr
\ No newline at end of file +Run <NetSurf$Dir>.!RunImage %*0 2><Wimp$ScrapDir>.WWW.NetSurf.Log
\ No newline at end of file @@ -31,7 +31,7 @@ OBJECTS_IMAGE = gif.o gifread.o jpeg.o mng.o # image/ OBJECTS_RISCOS = $(OBJECTS_COMMON) $(OBJECTS_IMAGE) OBJECTS_RISCOS += browser.o netsurf.o selection.o textinput.o \ version.o # desktop/ -OBJECTS_RISCOS += 401login.o artworks.o awrender.o bitmap.o \ +OBJECTS_RISCOS += 401login.o artworks.o assert.o awrender.o bitmap.o \ buffer.o debugwin.o \ dialog.o download.o draw.o filename.o filetype.o font.o \ global_history.o gui.o help.o history.o hotlist.o image.o \ diff --git a/riscos/assert.c b/riscos/assert.c new file mode 100644 index 000000000..96309bcef --- /dev/null +++ b/riscos/assert.c @@ -0,0 +1,46 @@ +/* + * This file is part of NetSurf, http://netsurf.sourceforge.net/ + * Licensed under the GNU General Public License, + * http://www.opensource.org/licenses/gpl-license + * Copyright 2005 James Bursa <bursa@users.sourceforge.net> + */ + +/** \file + * Assert reporting (RISC OS implementation). + */ + +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> +#include <oslib/wimp.h> + + +/** + * Report an assert() failure and exit. + */ + +void __assert2(const char *expr, const char *function, const char *file, + int line) +{ + static const os_error error = { 1, "NetSurf has detected a serious " + "error and must exit. Please submit a bug report, " + "attaching the browser log file." }; + + fprintf(stderr, "\n\"%s\", line %d: %s%sAssertion failed: %s\n", + file, line, + function ? function : "", + function ? ": " : "", + expr); + fflush(stderr); + + xwimp_report_error_by_category(&error, + wimp_ERROR_BOX_GIVEN_CATEGORY | + wimp_ERROR_BOX_CATEGORY_ERROR << + wimp_ERROR_BOX_CATEGORY_SHIFT, + "NetSurf", "!netsurf", + (osspriteop_area *) 1, "Quit", 0); + + xos_cli("Filer_Run <Wimp$ScrapDir>.WWW.NetSurf.Log"); + + abort(); +} |