path: root/src/corelib/tools/qdatetime.h
diff options
authorSimon Hausmann <>2012-06-12 09:57:10 +0200
committerQt by Nokia <>2012-06-13 23:24:08 +0200
commit5230d62feb8822743b8204382225485f27bc7b69 (patch)
tree836f9207cd28b71965ae7c07d6e895eba2262a7f /src/corelib/tools/qdatetime.h
parent1d859ef80540ec3dd64f4f7bda3a8e415965650c (diff)
Partial fix for WebKit compilation on Windows
qdatetime.h uses std::min/max and on Windows windows.h (or some subsequent header file) may under certain circumstances define min/max as macros. The easiest way to prevent the windows header files from doing that is to define NOMINMAX in the place right before windows.h is included. The other way is to define min and max to min/max themselves to prevent windows.h from doing its evil thing. If a user of Qt (WebKit in this case) chooses the approach of defining min/max to themselves and then includes qdatetime.h, then a subsequent inclusion of windows.h doesn't work because qdatetime.h undefines min/max. We should not enforce the type of workaround needed, therefore this patch removes the workaround from qdatetime.h and requires user code that happens to include windows header files before qdatetime.h (seldom case) to choose either workaround. Change-Id: I7347eec7369491a065e894cff557004e069453d5 Reviewed-by: Thiago Macieira <>
Diffstat (limited to 'src/corelib/tools/qdatetime.h')
1 files changed, 0 insertions, 9 deletions
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index af257eaa40..a648285e89 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -46,15 +46,6 @@
#include <QtCore/qnamespace.h>
#include <QtCore/qsharedpointer.h>
-// windows.h defines these identifiers, so undefine it
-// ### figure out where in Qt we include it too soon
-#ifdef max
-# undef max
-#ifdef min
-# undef min
#include <limits>