> Huw D M Davies <h.davies1Éphysics.ox.ac.uk> writes:
> 
> > Well for _fullpath I really don't see the problem of adding our own
> > stdlib.h with include_next <stdlib.h> and the additional 
> declarations.
> 
> Then there are 3 stdlib.h to choose from (the Windows one, the Unix
> one, and the include_next one). It seems to add a lot of confusion for
> very little gain.

It is a little confusion yes, but perhaps that is the price we must pay.
 
> > I'm not sure what you mean here.  Are you saying Winelib apps can't
> > use Unix fd_set or Windows fd_set?   They clearly can't use both.
> 
> They can't use both, and since Wine is using the Windows definitions
> they very likely cannot use the Unix ones; unless the app absolutely
> never uses a single Windows API that needs the corresponding type,
> which I think very unlikely for real apps. This may be viable for
> fd_set, 

As I said, we must of course link with different libraries. So?

> but not for things like wchar_t,

32-bit UNICODE ("wchar_t") is a little bit more trouble since
as the appear everwhere but that is just mean that either all
libraries must be duplicated or that we have a translation
layer that translate 16-bit to 32-bit and the opposite. Some
work to implement yes, but no theoretical problem.

As a sidenote I have often wondered whether perhaps it would
be better to implement functions that exists are both ANSI and
UNICODE as just one implementation in a file that is compiled
twice. This could be extended to 32-bit UNICODE by compiling
them thrice...

> or file handles.

Well you can interchange Win32 file handles with C library
handles in Windows either. The functions
        _CRTIMP long __cdecl _get_osfhandle(int);
        _CRTIMP int __cdecl _open_osfhandle(long, int);
exist for such purposes.

Of course all Windows code will not run out of the box,
but the most important thing is to be able to write code
that works on both Windows and WineLib which contains
as few #ifdef:s as possible, preferably none.

In short, I can see a lot of work to get everything to interact
properly, but I really can't see any fundamental teoretical problems.
Perhaps you can, or have, but you need to explain better what
you mean, preferably with examples. I am not convinced.

Reply via email to