[MPlayer-dev-eng] osdep/fseeko.c problem []

Arne Driescher Arne.Driescher at gmx.de
Wed Jun 8 00:10:55 CEST 2005


Problem description:
=============
GCC complains when compiling ftello() 
fseeko.c: In function `ftello':
fseeko.c:82: error: incompatible types in return

System:
=====
- gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)
- SuSE 9.3 AMD64
File version: 
========
newest CVS version (0:02 2005-06-08)

Related information that might help with the problem:
===================================
As "man ftello" gives:
     #include <stdio.h>
      int fseeko(FILE *stream, off_t offset, int whence);
      off_t ftello(FILE *stream);
and
_G_config.h gives
 typedef struct
{
  __off_t __pos;
  __mbstate_t __state;
} _G_fpos_t;
#define _G_off_t        __off_t
and 
stdio.h:typedef _G_fpos_t fpos_t;

I suggest the patch below to make it compile. This might be broken on other
platforms (that I have no way to test.)
 
However, it seems to me that the base of the problem is that HAVE_FTELLO 
should have been defined so that this function would never compile on that 
plattform .
Btw.: The configure script is broken too as -march and -mcpu are not set 
correctly. It would be nice if someone could fix it. (Perhaps whenever the 
test fails, just drop -march and -mcpu from the CFLAGS as the plattform 
default might be useful anyway.)

Greetings,
Arne


Index: osdep/fseeko.c
===================================================================
RCS file: /cvsroot/mplayer/main/osdep/fseeko.c,v
retrieving revision 1.2
diff -u -r1.2 fseeko.c
--- osdep/fseeko.c	4 Apr 2004 10:38:57 -0000	1.2
+++ osdep/fseeko.c	7 Jun 2005 21:51:11 -0000
@@ -79,6 +79,6 @@
 
 	if (fgetpos(stream, &floc) != 0)
 		return -1;
-	return floc;
+	return floc.__pos;
 }
 #endif




More information about the MPlayer-dev-eng mailing list