Re: [Mingw-users] windows.h dependency
- Date: Sat, 2 Feb 2008 11:49:46 -0500
- From: NightStrike <nightstrike@xxxxxxxxx>
- Subject: Re: [Mingw-users] windows.h dependency
On 2/2/08, Keith Marshall <keithmarshall@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On Saturday 02 February 2008 15:37, NightStrike wrote:
> > I would think that a user should only include windows.h if
> > his own code requires it, not if a library he is using requires it.
> > That library should handle its own dependencies, yes?
>
> Yes. What possible benefit can be gained from #including *any* header,
> if your compilation unit has no direct dependency on it?
>
> This isn't peculiar to windows.h; it applies equally to every header.
It applies to windows.h in so far as that I tried individually
compiling every header in mingw with something like this in a script
where $file is each .h header:
#include <$file>
int main() {return 0;}
The number of errors drops considerably when I change it to:
#include <windows.h>
#include <$file>
int main() {return 0;}
So basically, a number of mingw headers won't compile unless windows.h
is also included. If those headers require windows.h, I would think
that they should include it themselves.
I am assuming that I am misunderstanding something here that everyone
sees very clearly. Could you enlighten me?
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users