This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/49386] #undef min/max is dependent on order if #include


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49386

--- Comment #3 from Chris Jefferson <chris at bubblescope dot net> 2011-06-13 08:15:39 UTC ---
Ah yes. This is unfortunate, and I believe tricky to fix at the gcc end. We
could in principle add '#undef min, #undef max', but I worry that might break
something else.

If you '#define NOMINMAX' before including windows.h, that should stop the
declarations, although it can break some windows libraries. The other option is
to do:

#include <windows.h>
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]