On Wednesday 30 January 2008 12:19, Earnie Boyd wrote:
> Quoting Dave Korn <dave.korn@...>:
> > On 30 January 2008 08:49, Vincent Torri wrote:
> >> On Tue, 29 Jan 2008, NightStrike wrote:
> >>> Is it required that every program #include <windows.h> before
> >>> using most of the mingw headers?
> >> Not always. See msdn. For example, when using sockets, you lay
> >> just need winsock2.h
> > Well, that's because winsock2.h #includes windows.h anyway, pretty
> > much first thing it does.
> So for completeness the MinGW rule is "You must #include <windows.h>
> before any other header." If you decide to follow other rules then
> look elsewhere for help.
When I first read this, I thought `that's a rather draconian rule';
indeed, in my own code, it would be honoured more in the breach, than
in the observance thereof. However, since my code falls mostly into
On Wednesday 30 January 2008 09:10, Tor Lillqvist wrote:
> And of course, programs that use just standard C library functions
> have no need at all to include <windows.h>. They just need <stdio.h>,
> <stdlib.h>, etc, like on any C89 platform.
...it would seem that such a `rule' has no relevance whatsoever.
On Wednesday 30 January 2008 12:30, Earnie Boyd wrote:
> Oh, you make me need to change my rule. ;D
Surely, the rule should be that any compilation unit, which refers to
Microsnot specific functions, (e.g. those whose names are uglified by a
leading underscore, or have mixed case names), should include precisely
those headers which are documented, on MSDN, as being required. To
prescribe any other usage seems unnecessary.