Web lists-archives.org

Re: [Mingw-users] windows.h dependency




On Sunday 03 February 2008 13:08, NightStrike wrote:
> On 2/3/08, Tor Lillqvist <tml@xxxxxx> wrote:
> > Is this how you approach programming in general? Just randomly try
> > things without looking at recommended practice or code samples. I
> > very
>
> Yet another reason why of all the mailing lists I'm on, this one is
> the absolute worst......

Well, no one is forcing you to be here; if you don't like what you see, 
you may just quietly go away, but please, let's not have any flame wars 
on the list.

In fact, Tor did raise a perfectly valid point; (thanks Tor for the 
pertinent reminder).  It is common on MSDN, to see documentation for 
API functions, which says `defined in foo.h; include windows.h'.  The 
implication of this is that foo.h is present in the headers directory, 
but you are not expected to include it directly in your own code; you 
are to include windows.h, which will take care of including foo.h for 
you.  Your test for which headers have an inherent dependency on 
windows.h *is* naive, for it doesn't recognise this scenario.

I am not saying that your patch should be rejected out of hand, but it 
will require careful review.  If you have added `#include <windows.h>' 
to files which are themselves intended to be included as a consequence 
of including windows.h, then you have erroneously introduced circular 
references.  You may not notice the error, because you are protected by 
guard logic, designed to prevent multiple inclusion of the headers in 
question, but it is nevertheless an error, which should be avoided.

Regards,
Keith.

-------------------------------------------------------------------------
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