diff options
author | krion <krion@FreeBSD.org> | 2004-10-12 20:05:44 +0800 |
---|---|---|
committer | krion <krion@FreeBSD.org> | 2004-10-12 20:05:44 +0800 |
commit | f1bd22c1b2e53006b01eabc0950cd7db8aedb60b (patch) | |
tree | 741aa79bec5854984a47ba184a6444a8d1ffb04e /graphics | |
parent | 1d519427772984f3e84eb17ac3b975fbe0806a39 (diff) | |
download | freebsd-ports-gnome-f1bd22c1b2e53006b01eabc0950cd7db8aedb60b.tar.gz freebsd-ports-gnome-f1bd22c1b2e53006b01eabc0950cd7db8aedb60b.tar.zst freebsd-ports-gnome-f1bd22c1b2e53006b01eabc0950cd7db8aedb60b.zip |
Fix build on 4-stable with system compiler
PR: ports/72321
Submitted by: Ports Fury
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/gliv/Makefile | 1 | ||||
-rw-r--r-- | graphics/gliv/files/patch-src::collection.c | 87 |
2 files changed, 86 insertions, 2 deletions
diff --git a/graphics/gliv/Makefile b/graphics/gliv/Makefile index 0d7f1236cb6e..3024c9d92ac4 100644 --- a/graphics/gliv/Makefile +++ b/graphics/gliv/Makefile @@ -16,7 +16,6 @@ COMMENT= An image viewer that uses Gdk-Pixbuf and OpenGL LIB_DEPENDS= gtkglext-x11-1.0.2:${PORTSDIR}/x11-toolkits/gtkglext USE_BZIP2= yes -USE_GCC= 3.4 USE_X_PREFIX= yes USE_GL= yes USE_GETOPT_LONG= yes diff --git a/graphics/gliv/files/patch-src::collection.c b/graphics/gliv/files/patch-src::collection.c index b9e0e10ada7d..1f046e57c2ce 100644 --- a/graphics/gliv/files/patch-src::collection.c +++ b/graphics/gliv/files/patch-src::collection.c @@ -1,5 +1,5 @@ --- src/collection.c.orig Thu Jul 29 06:40:56 2004 -+++ src/collection.c Thu Aug 5 01:05:38 2004 ++++ src/collection.c Thu Sep 30 20:46:04 2004 @@ -77,6 +77,7 @@ * are '\0' terminated strings representing decimal numbers. */ @@ -8,3 +8,88 @@ #include <sys/mman.h> /* mmap(), PROT_READ, MAP_PRIVATE, ... */ #include <stdio.h> /* FILE, fopen(), fread(), fwrite(), ... */ #include <string.h> /* strlen(), strrchr() */ +@@ -638,8 +639,8 @@ + guchar *base; + guchar *ptr; + guchar *end; +- }; +- }; ++ } s; ++ } u; + }; + + static void free_buffer(struct coll_src *source, guchar * buffer) +@@ -655,16 +656,16 @@ + + if (source->is_file) { + data = g_new(guchar, length); +- if (fread(data, 1, length, source->file) != length) { ++ if (fread(data, 1, length, source->u.file) != length) { + g_free(data); + return NULL; + } + } else { +- if (source->ptr + length > source->end) ++ if (source->u.s.ptr + length > source->u.s.end) + return NULL; + +- data = source->ptr; +- source->ptr += length; ++ data = source->u.s.ptr; ++ source->u.s.ptr += length; + } + + if (is_string && data[length - 1] != '\0') { +@@ -678,12 +679,12 @@ + static gint read_char(struct coll_src *source) + { + if (source->is_file) +- return fgetc(source->file); ++ return fgetc(source->u.file); + +- if (source->ptr >= source->end) ++ if (source->u.s.ptr >= source->u.s.end) + return EOF; + +- return *(source->ptr++); ++ return *(source->u.s.ptr++); + } + + static GdkPixbufDestroyNotify destroy_func(struct coll_src *source) +@@ -855,22 +856,22 @@ + goto no_mmap; + } + +- source->base = mmap(NULL, length, PROT_READ, MAP_PRIVATE, fileno(file), 0); +- if (source->base == MAP_FAILED) { ++ source->u.s.base = mmap(NULL, length, PROT_READ, MAP_PRIVATE, fileno(file), 0); ++ if (source->u.s.base == MAP_FAILED) { + perror("mmap"); + goto no_mmap; + } + + source->is_file = FALSE; +- source->ptr = source->base; +- source->end = source->base + length; ++ source->u.s.ptr = source->u.s.base; ++ source->u.s.end = source->u.s.base + length; + goto ok; + + no_mmap: + fseeko(file, 0, SEEK_SET); + + source->is_file = TRUE; +- source->file = file; ++ source->u.file = file; + + ok: + return source; +@@ -879,7 +880,7 @@ + static void destroy_source(struct coll_src *source, gboolean ok) + { + if (ok == FALSE && source->is_file == FALSE) +- if (munmap(source->base, source->end - source->base) < 0) ++ if (munmap(source->u.s.base, source->u.s.end - source->u.s.base) < 0) + perror("munmap"); + } + |