[Liblas-commits] hg: Disable Koenig lookup for min/max functions to solve potenti...

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Jan 26 17:28:57 EST 2010


changeset 09b9b4ed037a in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=09b9b4ed037a
summary: Disable Koenig lookup for min/max functions to solve potential problems in the presence of min/max macros on Windows platform. Note, users are advised to define NOMINMAX preprocessor macro on when using libLAS on Windows.

diffstat:

 include/liblas/detail/utility.hpp |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (25 lines):

diff -r a8e8f0384280 -r 09b9b4ed037a include/liblas/detail/utility.hpp
--- a/include/liblas/detail/utility.hpp	Tue Jan 19 16:15:19 2010 -0600
+++ b/include/liblas/detail/utility.hpp	Tue Jan 26 22:28:08 2010 +0000
@@ -45,9 +45,9 @@
 #include <liblas/cstdint.hpp>
 #include <liblas/detail/endian.hpp>
 // std
+#include <cassert>
 #include <cstddef>
 #include <cstring>
-#include <cassert>
 #include <algorithm>
 #include <iosfwd>
 #include <limits>
@@ -299,8 +299,8 @@
 {
     // Requires pseudo-random numbers generator to be initialized
     // in create_random_based() function - a poor man solution.
-    T const rmin = std::numeric_limits<T>::min();
-    T const rmax = std::numeric_limits<T>::max();
+    T const rmin = (std::numeric_limits<T>::min)();
+    T const rmax = (std::numeric_limits<T>::max)();
     unsigned int const rnd = std::rand() % rmax + rmin;
 
     assert(rnd <= 255);


More information about the Liblas-commits mailing list