Web lists-archives.org

Re: [Mingw-users] windows.h dependency




> 
> 
> On 2/2/08, Keith Marshall <keithmarshall@xxxxxxxxxxxxxxxxxxxxx> wrote:
> > On Saturday 02 February 2008 19:57, NightStrike wrote:
> > > If I put "#include <windows.h> at the top of all of these files,
> > > should it go before or after the extern C stuff?  ie, this:
> > >
> > > #ifdef __cplusplus
> > > extern "C" {
> > > #endif
> >
> > It should go before that; it should do its own determination of what
> > should be `extern "C"', and you don't want to accidentally include
> > anything in that category, which doesn't belong there.
> 
> Ok.  I will have a patch when I get back from church.
> 

In some files, the inclusion of windows.h needs to be guarded, eg in 
COM headers like oaidl.h 

#ifndef COM_NO_WINDOWS_H
#include <windows.h>
#include <ole2.h>
#endif

Also look at objbase.h and rpc.h for another example of problem that can
arise with unconditional inclusion of windows.h.

Some files (eg winerror.h, sql.h), don't need windows.h pollution at
all.

But all these cases wll fall out with testing.

Danny 


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