[MPlayer-dev-eng] [PATCH] getch2() support for OS/2

Diego Biurrun diego at biurrun.de
Wed Feb 20 09:16:01 CET 2008


On Tue, Feb 19, 2008 at 04:19:49PM +0900, KO Myung-Hun wrote:
> 
> Alban Bedel wrote:
> > On Tue, 19 Feb 2008 02:17:37 +0900
> > KO Myung-Hun <komh at chollian.net> wrote:
> >   
> >> @@ -2851,10 +2855,12 @@
> >>  mp_input_init(use_gui);
> >>    mp_input_add_key_fd(-1,0,mplayer_get_key,NULL);
> >>  if(slave_mode)
> >> -#ifndef __MINGW32__
> >> +#ifdef __MINGW32__
> >> +  mp_input_add_cmd_fd(0,0,mp_input_win32_slave_cmd_func,NULL);
> >> +#elif defined(__OS2__)
> >> +  mp_input_add_cmd_fd(0,0,mp_input_os2_slave_cmd_func,NULL);
> >> +#else
> >>     mp_input_add_cmd_fd(0,1,NULL,NULL);
> >> -#else
> >> -  mp_input_add_cmd_fd(0,0,mp_input_win32_slave_cmd_func,NULL);
> >>  #endif
> >>  else if(!noconsolecontrols)
> >>      mp_input_add_event_fd(0, getch2);
> >
> > imho this should be done in a different way. This #ifdef mess is really
> > ugly. A single name for all slave_cmd functions is enouth, the build
> > system only compile the correct one anyway. And the NULL vs.
> > mp_input_slave_cmd_func can be solved with a simple define.
> 
> Even in your case, we cannot avoid #ifdef statement to define macros for 
> slave_cmd functions and select flag.
> 
> I think, there is no big difference between them.

Uglyness in other places is no excuse.  Give Alban's suggestion a try.

Diego



More information about the MPlayer-dev-eng mailing list