media/liboggz/wince.patch
author Benjamin Smedberg <benjamin@smedbergs.us>
Mon, 29 Jun 2009 14:31:58 -0400
changeset 35732 fc6ed914e44e888e9fef446de12ad915d156555d
parent 24098 59a7078453b07488ca6ef40c52f232561d6f47b2
child 32097 8217d78ccdafd4f3f2eb581a0db84f314c0075fe
permissions -rw-r--r--
Build the pieces of the chromium code we actually need. Many thanks to bent for doing this the first time: I redid the Makefile to be all in one directory and use vpath directives so that dependencies work correctly.

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;