[MPlayer-dev-eng] [PATCH] Support locale under Windows console
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Mar 6 12:26:22 CET 2007
Hello,
On Thu, Mar 01, 2007 at 07:00:51PM +0800, Zuxy Meng wrote:
> 2007/3/1, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> >On Thu, Mar 01, 2007 at 06:10:21PM +0800, Zuxy Meng wrote:
> >> 2007/3/1, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> >> >On Thu, Mar 01, 2007 at 12:39:20PM +0800, Zuxy Meng wrote:
> >> >> -
> >> >> +#include <stdio.h>
> >> >> #include <windows.h>
> >> >> #include "keycodes.h"
> >> >> #include "input/input.h"
> >> >>
> >> >> int mp_input_win32_slave_cmd_func(int fd,char* dest,int size){
> >> >> DWORD retval;
> >> >> - HANDLE stdin = GetStdHandle(STD_INPUT_HANDLE);
> >> >> - if(!PeekNamedPipe(stdin, NULL, size, &retval, NULL, NULL) ||
> >!retval){
> >> >> + HANDLE hd_stdin = GetStdHandle(STD_INPUT_HANDLE);
> >> >> + if(!PeekNamedPipe(hd_stdin, NULL, size, &retval, NULL, NULL) ||
> >> >!retval){
> >> >
> >> >
> >> >just put the stdio.h include into the USE_ICONV ifdef below. That's not
> >> >too beautiful but not more ugly than this...
> >>
> >> The purpose to include <stdio.h> was to avoid warnings about
> >> undeclared "snprintf": just don't want to introduce more warnings in
> >> the new code. However, "printf" had been used in old code, too; so
> >> after I did what you suggested, there were still warnings. So we can
> >> either:
> >> 1. Ignore the warning and don't bother <stdio.h> at all.
> >> 2. Rename stdin....
> >
> >3. #undef stdin after the include
> >4. change printf to mp_msg in a separate patch
> >5. add stdio.h and rename stdin in a separate patch
>
> OK. Let's deal with this header later.
Applied with minor changes (tabs vs. spaces).
Including only config.h would cause compilation to fail for me, so I
fixed the stdio.h problem first.
Greetings,
Reimar Döffinger
More information about the MPlayer-dev-eng
mailing list