diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2004-05-02 17:01:37 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2004-05-02 17:01:37 +0000 |
commit | afb5e4209bce0dd6979e06593dc7ffb311365807 (patch) | |
tree | 6767851f213cc58e955c86865007d45d05adf8d9 /riscos | |
parent | f310036536181de0c007606e20cf3ae2c2db9fa0 (diff) | |
download | netsurf-afb5e4209bce0dd6979e06593dc7ffb311365807.tar.gz netsurf-afb5e4209bce0dd6979e06593dc7ffb311365807.tar.bz2 |
[project @ 2004-05-02 17:01:37 by jmb]
Remove #ifdef nastiness. Now uses alloca.
svn path=/import/netsurf/; revision=816
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/theme.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/riscos/theme.c b/riscos/theme.c index f20705e69..2febebc0b 100644 --- a/riscos/theme.c +++ b/riscos/theme.c @@ -10,6 +10,7 @@ * Toolbar themes (implementation). */ +#include <alloca.h> #include <assert.h> #include <stdio.h> #include <string.h> @@ -37,26 +38,7 @@ void ro_theme_load(char *pathname) char name[] = "toolbar"; int context, window_size, data_size, size, i; static char *data = 0; - /** - * \note - * This is necessary as, when compiling with Norcroft 5.54, - * linking fails due to it trying to use - * __rt_allocauto and __rt_freeauto to allocate (and free) - * the stack space used by the filename buffer. - * These symbols are provided by the SCL but not by Unixlib - * - * \note - * There are three possible ways around this \#ifdef nastiness: - * - Allocate filename on the heap instead - * - Get NetSurf to build and link against the SCL - * - Implement __rt_allocauto and __rt_freeauto for Unixlib - * - */ -#ifdef __GNUC__ - char filename[strlen(pathname) + 12]; -#else - char *filename = xcalloc(strlen(pathname) + 12, sizeof(char)); -#endif + char *filename = alloca(strlen(pathname) + 12); fileswitch_object_type obj_type; /* free old theme data */ @@ -117,9 +99,6 @@ void ro_theme_load(char *pathname) theme_throbs = n; } } -#ifndef __GNUC__ - xfree(filename); -#endif } |