-Fixed issue with VS2017 compiling

This commit is contained in:
Joshua Hintze 2021-10-15 19:31:45 -06:00
parent 0edb018465
commit 15798e6ebb
2 changed files with 6 additions and 4 deletions

View file

@ -24,6 +24,7 @@
#define MAPNIK_UTIL_CHAR_ARRAY_BUFFER_HPP #define MAPNIK_UTIL_CHAR_ARRAY_BUFFER_HPP
#include <streambuf> #include <streambuf>
#include <algorithm>
namespace mapnik { namespace util { namespace mapnik { namespace util {
@ -71,16 +72,16 @@ private:
pos_type seekpos(pos_type off, pos_type seekpos(pos_type off,
std::ios_base::openmode /*which*/) std::ios_base::openmode /*which*/)
{ {
current_ = std::min(begin_ + off, end_); current_ = (std::min)(begin_ + off, end_);
return pos_type(off_type(current_ - begin_)); return pos_type(off_type(current_ - begin_));
} }
pos_type seekoff(off_type off, std::ios_base::seekdir dir, pos_type seekoff(off_type off, std::ios_base::seekdir dir,
std::ios_base::openmode which = std::ios_base::in | std::ios_base::out ) std::ios_base::openmode which = std::ios_base::in | std::ios_base::out )
{ {
if (dir == std::ios_base::beg) current_ = std::min(begin_ + off, end_); if (dir == std::ios_base::beg) current_ = (std::min)(begin_ + off, end_);
else if (dir == std::ios_base::cur) current_ = std::min(current_ + off, end_); else if (dir == std::ios_base::cur) current_ = (std::min)(current_ + off, end_);
else current_ = std::max(end_ - off, begin_); // dir == std::ios_base::end else current_ = (std::max)(end_ - off, begin_); // dir == std::ios_base::end
return pos_type(off_type(current_ - begin_)); return pos_type(off_type(current_ - begin_));
} }
char const * const begin_; char const * const begin_;

View file

@ -39,6 +39,7 @@ MAPNIK_DISABLE_WARNING_POP
// stl // stl
#include <fstream> #include <fstream>
#include <memory> #include <memory>
#include <algorithm>
namespace mapnik namespace mapnik
{ {