wxWindows: it's official!

Francois Gouget fgouget at free.fr
Tue Jan 7 14:00:04 CST 2003


On Tue, 7 Jan 2003, Dimitrie O. Paun wrote:

> Sorry about my previous attempt, I've pressed Send by mistake.
> And I've learned you can't stop KMail from sending... :)
>
> On January 7, 2003 02:09 pm, Francois Gouget wrote:
> > include/io.h
> > include/msvcrt/io.h
> >
> > That seems like an include order nightmare. Furthermore your header only
> > contains:
> > int access(const char *__path, int __amode);
>
> It's a big problematic, but not much. winegcc get this right anyway,
> and I can't see how it can be a problem: if you use msvcrt, you first
> have to include those headers. If not, they are not in the search path,
> so they don't exist. What scenario to you forsee where this can be a
> problem.

The case where a developper mistakenly does:
-I/usr/include/wine -I/usr/include/wine/msvcrt

And then wonders why things don't compile...


[...]
> Thing is, the cygwin io.h contains only these definitions:
>
> extern long get_osfhandle(int);
> extern int setmode (int __fd, int __mode);
> int access(const char *__path, int __amode);

Yes, but Mingw applications are Windows applications and thus hey use
Windows paths (c:\Windows\wininit.ini) and link with a C library that
understands these Windows paths. But that will definitely not work in
Wine unless you link with msvcrt.
There's no way around that.


> That's the user's choice. We need to support io.h, mingw has it, cygwin
> has it. If we provide it only in msvcrt, we force everybody to use msvcrt,
> which is not right IMO.

For Cygwin the situation is different (symetrical to the Winlib one in
fact). The applications are Unix applications that use Unix paths
(/windows/wininit.ini) on Windows and thus have to link with the Cygwin
C library rather than the system 'native' C library (msvcrt).
(or crtdll, but no one on Windows uses crtdll)

For exactly the same reasons, Winelib applications, using Windows paths
(c:\Windows\wininit.ini) on Unix have to link with the Wine C library
(msvcrt) rather than the native one (glibc) in order to call functions
with these paths.


[...]
> Since program not using msvcrt expect only these funtions,
> that's what we need to provide. I don't know what get_osfhandle(),
> and setmode() are (they are not standard Unix functions), I've
> added included only access().

They are both implemented in msvcrt.


-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.





More information about the wine-devel mailing list