From: Oscar F. <of...@wa...> - 2002-09-13 20:14:44
|
[John: please observe the Reply-To message field. Thanks.] John Allen Green <joh...@ya...> writes: First of all, this works: #define __GTHREAD_HIDE_WIN32API 1 #include <iostream> enum { ABSOLUTE = 10 }; int main() { std::cout << ABSOLUTE << " hola\n"; } I don't know if the above is feasible on real-world programs. > --On 13/09/2002 7:04 PM +0200 Oscar Fuentes wrote: > > > ABSOLUTE is a #define in wingdi.h. It's there since forever, but seems > > that until recently there was less demand for Win32 functionality on > > C/C++ library headers. > > In the previous downloads I'd been using, ABSOLUTE was not bleeding > through, unless I #include <windows.h>. Even that was a new problem, > compared to the 2.96 download of MinGW I'd been using. gcc 3.2 contains a compliant, template-based C++ library. One can expect a lot differences wrt 2.95.x I was reading the gthr-default.h file and there are some things that worths mentioning. It provides several options for the same functionality, for example. I'll let the maintainers explain why they chose to default to one way and not to another. [snip] > Including the entire windows.h is not necessary. There is always a way to > declare only the pieces that you need. And I'm pretty sure most of the > standard C++ headers don't need TRANSPARENT, ABSOLUTE, BIGENDIAN, ERROR, > LITTLEENDIAN, etc. MS says the right way is #including <windows.h> It is not guaranteed that including just one header will work. > Of course, there's a difference between what's possible and what's > practical. I'm sure if it was practical, it would have been avoided. > > I don't know. Yeesh. I hate to think that I'm getting all kinds of hidden > junk from random headers just because I #include <iostream>. It sure > doesn't seem to be within the spirit of C++. I'm with you here. > What do the other compilers do? Has Cygwin gone this route? RogueWave, the SC++L that comes with Borland 5.5.1, has headers that #includes windows.h. Same for STLPort 4.5.3. [snip] -- Oscar |