diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-08-24 12:05:00 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-08-24 12:05:00 +0000 |
commit | 55888a00fe0cca86f2c5fb38ad4f8d4b43efcd70 (patch) | |
tree | 57cf4887ed62895fa8b4ea243fc30d198c3a7b7e /utils | |
parent | 03d181b65da62ed9ab843d8612cd9413ca6fa6c0 (diff) | |
download | netsurf-55888a00fe0cca86f2c5fb38ad4f8d4b43efcd70.tar.gz netsurf-55888a00fe0cca86f2c5fb38ad4f8d4b43efcd70.tar.bz2 |
Portability hacks.
svn path=/trunk/netsurf/; revision=9432
Diffstat (limited to 'utils')
-rw-r--r-- | utils/memdebug.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/utils/memdebug.c b/utils/memdebug.c index c8e28dc32..bc5900038 100644 --- a/utils/memdebug.c +++ b/utils/memdebug.c @@ -39,6 +39,9 @@ #include <stdlib.h> #include <unistd.h> #include <sys/socket.h> +#ifdef riscos +#include <unixlib/local.h> +#endif #include "oslib/os.h" #include "oslib/osfile.h" @@ -50,7 +53,9 @@ #define MAGIC 0x34343434 #define GUARD 0x34 +#if defined(riscos) && !defined(__ELF__) extern int __dynamic_num; +#endif struct memdebug { size_t size; @@ -286,6 +291,8 @@ void memdebug_free(void *ptr, int line, const char *source) fprintf(logfile, "MEM %s:%d free(%p)\n", source, line, ptr); if (mem->magic != MAGIC) { fprintf(logfile, "MAGIC match failed!\n"); +#ifdef riscos + #ifndef __ELF__ if (__dynamic_num != -1) { int size; byte *base_address; @@ -296,6 +303,10 @@ void memdebug_free(void *ptr, int line, const char *source) xosfile_save("core", (bits) base_address, 0, base_address, base_address + size); } + #else + __unixlib_write_coredump(NULL); + #endif +#endif } fflush(logfile); for (i = 0; i != 8; i++) |