[RFC] io.h & friends

Dimitrie O. Paun dpaun at rogers.com
Thu Jan 9 10:14:32 CST 2003


On January 9, 2003 12:12 pm, Alexandre Julliard wrote:
> I think it would work. What you have to do is something like:
>
> #ifndef __UNIX__
> #include <io.h>
> #else
> #include <unistd.h>
> #endif

This so fast! :)

Remember, __UNIX__ is always defined when compiling in Wine, so
we can never include io.h. Which begs the question: why do we have
it in msvcrt in the first place? :)

I'd like to be able to compile an app with _and_ without the
msvcrt runtime, by adding/removing the -mno-cygwin switch.
The simplest thing to do would be to just:

#include <io.h>
#include <unistd.h>

and when compiling with the -mno-cygwin, I get an empty/small unistd.h,
and without the -mno-cygwin I get an empty/small io.h.

A include/cygwin would solve this nicely, we can simply stick in there
all the cygwin extensions (like io.h, and others), and in msvcrt we can
put the mingw extensions (such as unistd.h). The two includes will be
mutually exclusive, and you can choose between them with the -mno-cygwin
switch, the same as you do on Windows.

-- 
Dimi.




More information about the wine-devel mailing list