summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-01-21 23:48:34 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-01-21 23:48:34 +0000
commit5b0ad574b68b21ceef4ea167163c0a10d1d13d71 (patch)
treebb996417fbab422d5fb262417972f8d7c89b6daf /render
parent3c3536fd68f16ea9f995680fc24919acbffe1022 (diff)
downloadnetsurf-5b0ad574b68b21ceef4ea167163c0a10d1d13d71.tar.gz
netsurf-5b0ad574b68b21ceef4ea167163c0a10d1d13d71.tar.bz2
Fix compilation when BMP/PNG/GIF support is disabled.
svn path=/trunk/netsurf/; revision=9858
Diffstat (limited to 'render')
-rw-r--r--render/favicon.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/render/favicon.c b/render/favicon.c
index bc64f0a9e..4b9d381a6 100644
--- a/render/favicon.c
+++ b/render/favicon.c
@@ -166,14 +166,31 @@ bool favicon_get_icon(struct content *c, xmlNode *html)
void favicon_callback(content_msg msg, struct content *icon,
intptr_t p1, intptr_t p2, union content_msg_data data)
{
+ static const content_type permitted_types[] = {
+#ifdef WITH_BMP
+ CONTENT_ICO,
+#endif
+#if defined(WITH_MNG) || defined(WITH_PNG)
+ CONTENT_PNG,
+#endif
+#ifdef WITH_GIF
+ CONTENT_GIF,
+#endif
+ CONTENT_UNKNOWN
+ };
struct content *c = (struct content *) p1;
unsigned int i = p2;
+ const content_type *type;
+
+
switch (msg) {
case CONTENT_MSG_LOADING:
/* check that the favicon is really a correct image type */
- if (!((icon->type == CONTENT_ICO) ||
- (icon->type == CONTENT_PNG) ||
- (icon->type == CONTENT_GIF))) {
+ for (type = permitted_types; *type != CONTENT_UNKNOWN; type++)
+ if (icon->type == *type)
+ break;
+
+ if (*type != CONTENT_UNKNOWN) {
c->data.html.favicon = 0;
LOG(("%s is not a favicon", icon->url));
content_add_error(c, "NotFavIco", 0);