diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2004-05-02 01:04:38 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2004-05-02 01:04:38 +0000 |
commit | 51bea40b9a1bb15ba148ab3e939f9935d0c65e04 (patch) | |
tree | 12f94f1a73a91aa7184625ec3ba5d9ca3685a67e /riscos | |
parent | 8cb321ec78908552cfc1329da3d6efaeac1e8423 (diff) | |
download | netsurf-51bea40b9a1bb15ba148ab3e939f9935d0c65e04.tar.gz netsurf-51bea40b9a1bb15ba148ab3e939f9935d0c65e04.tar.bz2 |
[project @ 2004-05-02 01:04:38 by jmb]
A couple more Norcroft-related patches.
The use of #ifdef __GNU_C__ in both of these can be avoided. I'm not entirely sure whether it would be sensible to do so, so I've left them as-is.
svn path=/import/netsurf/; revision=814
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/theme.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/riscos/theme.c b/riscos/theme.c index 941318b03..f20705e69 100644 --- a/riscos/theme.c +++ b/riscos/theme.c @@ -37,7 +37,26 @@ 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 fileswitch_object_type obj_type; /* free old theme data */ @@ -98,6 +117,9 @@ void ro_theme_load(char *pathname) theme_throbs = n; } } +#ifndef __GNUC__ + xfree(filename); +#endif } |