gecko/media/liboggz/wince.patch

60 lines
1.5 KiB
Diff

diff --git a/media/liboggz/include/oggz/oggz_off_t.h b/media/liboggz/include/oggz/oggz_off_t.h
--- a/media/liboggz/include/oggz/oggz_off_t.h
+++ b/media/liboggz/include/oggz/oggz_off_t.h
@@ -39,6 +39,10 @@
*/
#ifdef _WIN32
+#ifdef WINCE
+ typedef long off_t;
+#endif
+
/* MSVC/Borland & Cygwin */
typedef off_t oggz_off_t;
diff --git a/media/liboggz/src/liboggz/oggz_seek.c b/media/liboggz/src/liboggz/oggz_seek.c
--- a/media/liboggz/src/liboggz/oggz_seek.c
+++ b/media/liboggz/src/liboggz/oggz_seek.c
@@ -572,32 +572,41 @@ static oggz_off_t
static oggz_off_t
oggz_offset_end (OGGZ * oggz)
{
+#ifndef WINCE
int fd;
struct stat statbuf;
+#endif
oggz_off_t offset_end = -1;
if (oggz->file != NULL) {
+#ifndef WINCE
if ((fd = fileno (oggz->file)) == -1) {
/*oggz_set_error (oggz, OGGZ_ERR_SYSTEM);*/
return -1;
}
if (fstat (fd, &statbuf) == -1) {
/*oggz_set_error (oggz, OGGZ_ERR_SYSTEM);*/
return -1;
}
if (oggz_stat_regular (statbuf.st_mode)) {
offset_end = statbuf.st_size;
#ifdef DEBUG
printf ("oggz_offset_end: stat size %" PRI_OGGZ_OFF_T "d\n", offset_end);
#endif
} else {
/*oggz_set_error (oggz, OGGZ_ERR_NOSEEK);*/
/* XXX: should be able to just carry on and guess, as per io */
/*return -1;*/
}
+#else
+ int current = ftell(oggz->file);
+ fseek (oggz->file, 0, SEEK_END);
+ offset_end = ftell (oggz->file);
+ fseek (oggz->file, current, SEEK_SET);
+#endif
} else {
oggz_off_t offset_save;