Skip to content

Commit 6e4f55a

Browse files
committed
<chromium> MSVC: Fix build issues when using std::numeric_limits::max
On Windows the core library did not compile because of a cascading include of base/time/time.h which includes windows.h. This in turn results in min and max macros being defined, which for some obscure reason msvc confuses when std::numeric_limits::max is used. Undef these unneeded macros to fix the build. Change-Id: I77555c7024787efb5fda9cb479311df906daea30 Reviewed-by: Pierre Rossi <[email protected]>
1 parent 85827b2 commit 6e4f55a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

chromium/base/time/time.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
// For FILETIME in FromFileTime, until it moves to a new converter class.
5151
// See TODO(iyengar) below.
5252
#include <windows.h>
53+
54+
#ifdef max
55+
# undef max
56+
# undef min
57+
#endif
5358
#endif
5459

5560
#include <limits>

0 commit comments

Comments
 (0)