"Dimitrie O. Paun" dpaun@rogers.com writes:
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? :)
Because not all apps are cygwin apps, and pure Windows apps are of course not going to test for __UNIX__.
I'd like to be able to compile an app with _and_ without the msvcrt runtime, by adding/removing the -mno-cygwin switch.
You can do that just fine with my solution, all we need is a trivial unistd.h in the msvcrt headers. Plus this way you also have a chance to build the app under normal Unix, where you will never have 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.
I don't think that's necessary, and we can't go around creating a new include hierarchy for every single Windows compiler out there, not to mention keeping track of all changes to the includes of all these compilers to replicate them in our environment. We need to define a portable solution that has a reasonable chance of working in all cases, even including cases that don't exist today. If it requires tweaking broken apps a bit that's acceptable.