Fix compile on Windows by avoiding min/max macros in windows.h.
authorRyan Volz <rvolz@mit.edu>
Tue, 17 Apr 2018 14:23:32 +0000 (10:23 -0400)
committerA. Maitland Bottoms <bottoms@debian.org>
Sat, 12 May 2018 19:25:04 +0000 (20:25 +0100)
Gbp-Pq: Name 0007-Fix-compile-on-Windows-by-avoiding-min-max-macros-in.patch

cmake/msvc/sys/time.h

index dca0fdf51b4968c7918b70863fb4685acf82cb2c..aa0f5dc2fb939ced7c8266e3d73c732bf783145e 100644 (file)
@@ -5,6 +5,11 @@
 #ifndef _MSC_SYS_TIME_H_
 #define _MSC_SYS_TIME_H_
 
+// prevent windows.h from clobbering min and max functions with macros
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+
 //http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/430449b3-f6dd-4e18-84de-eebd26a8d668
 #include < time.h >
 #include <windows.h> //I've omitted this line.