> Patrik Stridvall <psÉleissner.se> writes:
> 
> > We will only need mixed mode for applications that uses Windows
> > extentions defined is stdlib.h and friends that uses Unix
> > specific functions as well.
> > 
> > So yes it is not that common. Beside the Windows extentions
> > can be eliminated so I is not that critical either.
> 
> I'm afraid it will be common. Being able to access Unix functions is
> the interesting aspect of Winelib after all, if you don't need that
> you may as well continue to build as a .exe (like Corel does).

Yes, but was I meant is that if your application uses Windows
extentions like _fullpath, eliminating them is not that hard
so it might be worth to do that in order to be able to 
easily use Unix functions.
 
> And the real problem is that our system libraries and the Unix libc
> are not binary-compatible (and cannot be),

Yes, I know and the problem will only be worse on Itanium
since long is 32-bit in Windows and 64-bit on Unix.

> and no amount of headers
> hacking is going to fix that.

No, of course not, but a well written Windows application will not care.
The compiler will take care of that during compilation if we use some
clever enough header hacks in most cases.

Of course many Windows application are not well written, nor will it
be possible to solve all problem but it not nessary, if your application
works with mixed mode use it, if not don't.

> So I'm afraid there is no good solution
> that doesn't involve heavily modifying the application code.

Agreeed there is no good solution if we are talking about one size fits all.
What I am talking about is given the user three choices.

1. Window only mode 
2. Mixed mode
3. Unix mode

With Windows only we can't, as you say, link directly with the Unix
C library so we will have to provide binary compatible CRTDLL.
Not a particular problem, we need one for a 100% working emulator
anyway. Quite a lot of work to implement yes, but no direct problem.
Of course CRTDLL itself can link to Unix C library so we don't have
to reinvent the wheel.

With mixed mode we link with the Unix C library and hope that the
clever header tricks will save us. For some application it will,
for some it won't. At least it is better than nothing.

With Unix mode, we treat WineLib as any Unix library and calls
to Windows extensions like _fullpath are forbidden.

Windows only mode requires no change to the application,
mixed mode requires more and Unix mode still more. However
the important thing is that the user can fix his application
step by step, not requiring him to do everything at once and
even more importantly enabling him to keep a common tree
with the Windows version of the application at each step.

In short, I am quite aware that there is no ultimate solution,
but in any case my proposal, if it works, is IMHO a lot better
than what we currently have.

Reply via email to