| delorie.com/archives/browse.cgi | search |
| From: | zeil AT cs DOT odu DOT edu ("Steven J. Zeil") |
| Subject: | B17, min/max incompatabilities |
| 12 Mar 1997 14:47:02 -0800 : | |
| Approved: | cygnus DOT gnu-win32 AT cygnus DOT com |
| Distribution: | cygnus |
| Message-ID: | <Pine.SOL.3.95.970312160441.21891F-100000.cygnus.gnu-win32@powerwonky.cs.odu.edu> |
| Mime-Version: | 1.0 |
| Original-To: | gnu-win32 AT cygnus DOT com |
| Original-Sender: | owner-gnu-win32 AT cygnus DOT com |
The following code:
#include <windows.h>
#include <algobase.h>
int foo() {return 0;}
receives a pair of compilation errors within algobase.h complaining
that min and max are being used with the wrong numbers of arguments.
The problem is that Defines.h (included from windows.h) #define's min and
max as macros. But algobase.h defines them as template functions.
The net result is that windowing programs cannot use any of the STL
features.
Fix: In algobase.h, add lines
#undef min
#undef max
Steve Zeil
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |