[MPlayer-dev-eng] [PATCH] replace glibc basename by macro to fix --enable-menu on Cygwin

Sycotic Smith sycotic at linuxmail.org
Wed Jan 15 16:33:33 CET 2003


> couldn't this be defined somewhere else in cygwin headers ?
> after all there is cygwin inttypes.h that must be included to get
> mplayer to compile.
> if inttypes.h is included everywhere and we don't find this macro
> somewhere else, we could put it in cygwin_inttypes.h that already
> exists in main/etc.

Maybe in one of the cygwin ifdefs instead, define basename() as mp_basename(), or would that break something else?

> 
>  --- Diego Biurrun <diego at biurrun.de> a écrit : 
> > Hi!
> > 
> > I noticed some time ago that --enable-menu fails to compile on Cygwin
> > 
> > because menu_pt.c #includes libgen.h that is part of glibc and not 
> > available under Cygwin.  I therefore ripped the macro mp_basename out
> > of 
> > mplayer.c and put it in menu_pt.c instead of libgen.h.  It compiles,
> > it 
> > works.  I probably got it all wrong, so please tell me what I have to
> > do 
> > differently.  Anyway, here is the patch.
> > 
> > Diego
> > > Index: libmenu/menu_pt.c
> > ===================================================================
> > RCS file: /cvsroot/mplayer/main/libmenu/menu_pt.c,v
> > retrieving revision 1.2
> > diff -u -r1.2 menu_pt.c
> > --- libmenu/menu_pt.c	28 Dec 2002 18:51:09 -0000	1.2
> > +++ libmenu/menu_pt.c	15 Jan 2003 00:13:23 -0000
> > @@ -2,7 +2,6 @@
> >  #include <stdlib.h>
> >  #include <stdio.h>
> >  #include <string.h>
> > -#include <libgen.h>
> >  
> >  #include "../config.h"
> >  
> > @@ -19,6 +18,8 @@
> >  #include "../input/input.h"
> >  
> >  
> > +#define mp_basename(s)
> > (strrchr(s,'/')==NULL?(char*)s:(strrchr(s,'/')+1))
> > +
> >  
> >  extern play_tree_iter_t* playtree_iter;
> >  
> > @@ -127,7 +128,7 @@
> >    for( ; i != NULL ; i = i->next ) {
> >      e = calloc(1,sizeof(list_entry_t));
> >      if(i->files)
> > -      e->p.txt = basename(i->files[0]);
> > +      e->p.txt = mp_basename(i->files[0]);
> >      else
> >        e->p.txt = "Group ...";
> >      e->pt = i;
> > > _______________________________________________
> > MPlayer-dev-eng mailing list
> > MPlayer-dev-eng at mplayerhq.hu
> > http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
> >  
> 
> =====
> Sylvain Petreolle
> spetreolle at users.sourceforge.net 
> Fight against Spam ! http://www.euro.cauce.org/en/index.html
> ICQ #170597259
> 
> "Don't think you are. Know you are." Morpheus, in "Matrix".
> 
> ___________________________________________________________
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
> Yahoo! Mail : http://fr.mail.yahoo.com
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
> 

-- 
______________________________________________
http://www.linuxmail.org/
Now with POP3/IMAP access for only US$19.95/yr

Powered by Outblaze


More information about the MPlayer-dev-eng mailing list