[PATCH 2/3] msvcrt: Use the right _iob functions in the public msvcrt header for ucrtbase

Piotr Caban piotr.caban at gmail.com
Fri Nov 6 05:48:58 CST 2015


On 11/06/15 11:28, Martin Storsjo wrote:
>   #ifndef _STDIO_DEFINED
> -# ifdef __i386__
> -FILE* __cdecl __p__iob(void);
> -#  define _iob (__p__iob())
> +# ifdef UCRTBASE
> +FILE* __cdecl __acrt_iob_func(unsigned);
> +#  define _iob(x) (__acrt_iob_func(x))
>   # else
> +#  ifdef __i386__
> +FILE* __cdecl __p__iob(void);
> +#   define _iob(x) (__p__iob() + (x))
> +#  else
>   FILE* __cdecl __iob_func(void);
> -#  define _iob (__iob_func())
> +#   define _iob(x) (__iob_func() + (x))
> +#  endif
This makes _iob definition incompatible with native headers. It can't be 
done this way.

I don't know how to solve this problem. Maybe adding something like this 
in msvcp90/ios.c will be acceptable:
#if _MSVCP_VER >= 140
FILE* __cdecl __acrt_iob_func(unsigned);

#undef stdin
#define stdin __acrt_iob_func(STDIN_FILENO)
...
#endif

Thanks,
Piotr



More information about the wine-devel mailing list