[MPlayer-dev-eng] [PATCH] Compile mplayer on glibc-2.0

Mikulas Patocka mikulas at artax.karlin.mff.cuni.cz
Mon Aug 2 16:53:17 CEST 2004


Hi

This patch enables to compile mplayer on glibc-2.0 Linux.

Fixes:
- uint32_t is not the same as unsigned --- function prototype contained
unsigned and function definition uint32_t
- glibc-2.0 doesn't have modify_ldt function. Declare it with _syscall3
macro
- stdout and stderr are macros --- you can't assign to them. Assignment
doesn't make sense anyway, because freopen will always return the same FILE *
structure that it got in parameter.
- off_t is 32-bit, so you can't shift it by 32. Shift by 31 and 1 fixes
the problem.

Mikulas
-------------- next part --------------
--- libvo/vesa_lvo.h_	Mon Aug  2 00:51:25 2004
+++ libvo/vesa_lvo.h	Mon Aug  2 00:51:27 2004
@@ -17,7 +17,7 @@
 		   unsigned x_org,unsigned y_org,unsigned dst_width,
 		   unsigned dst_height,unsigned format,unsigned dest_bpp);
 void     vlvo_term( void );
-uint32_t vlvo_query_info(unsigned format);
+uint32_t vlvo_query_info(uint32_t format);
 
 uint32_t vlvo_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y);
 uint32_t vlvo_draw_frame(uint8_t *src[]);
--- ./loader/ldt_keeper.c_	Mon Aug  2 01:25:45 2004
+++ ./loader/ldt_keeper.c	Mon Aug  2 02:30:38 2004
@@ -33,7 +33,11 @@
 #ifdef  __cplusplus
 extern "C" {
 #endif
+#if !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR == 0)
+_syscall3( int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount );
+#else
 int modify_ldt(int func, void *ptr, unsigned long bytecount);
+#endif
 #ifdef  __cplusplus
 }
 #endif
--- ./osdep/vbelib.c_	Mon Aug  2 00:46:44 2004
+++ ./osdep/vbelib.c	Mon Aug  2 00:46:47 2004
@@ -111,8 +111,8 @@
   my_stderr = fopen(ttyname(fileno(stderr)),"w");
   __set_cursor_type(stdout,0);
 /*if(isatty(fileno(stdin ))) stdin =freopen("/dev/null","r",stdin );*/
-  if(isatty(fileno(stdout))) stdout=freopen("/dev/null","w",stdout);
-  if(isatty(fileno(stderr))) stderr=freopen("/dev/null","w",stderr);
+  if(isatty(fileno(stdout))) freopen("/dev/null","w",stdout);
+  if(isatty(fileno(stderr))) freopen("/dev/null","w",stderr);
 }
 
 static unsigned hh_int_10_seg;
--- libmpdemux/muxer_avi.c_	Mon Aug  2 16:16:25 2004
+++ libmpdemux/muxer_avi.c	Mon Aug  2 16:16:27 2004
@@ -605,7 +605,7 @@
 	idxhdr[3] = le2me_32(k);
 	idxhdr[4] = le2me_32(s->ckid);
 	idxhdr[5] = le2me_32(start + 8);
-	idxhdr[6] = le2me_32((start + 8)>> 32);
+	idxhdr[6] = le2me_32((start + 8) >> 31 >> 1);
 	idxhdr[7] = 0; /* unused */
 
 	si->superidx[j].len = 32 + 8*k;


More information about the MPlayer-dev-eng mailing list