Skip to content

Commit

Permalink
Fix msvc2019 winx64 compile issue (#5)
Browse files Browse the repository at this point in the history
* Fix msvc2019 winx64 compile issue

* Right fix for msvc

* Change std::min, and std::max presedence

---------

Co-authored-by: Weihang Ding <[email protected]>
  • Loading branch information
omrdk and xiaozhuai authored Jan 26, 2024
1 parent 11029fb commit 2215764
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/imageinfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class ReadInterface {

ReadInterface(ReadFunc &read_func, size_t length) : read_func_(read_func), length_(length) {
#ifndef II_DISABLE_HEADER_CACHE
header_cache_.alloc(std::min((size_t)II_HEADER_CACHE_SIZE, length));
header_cache_.alloc((std::min)((size_t)II_HEADER_CACHE_SIZE, length));
read(header_cache_.data(), 0, header_cache_.size());
#endif
}
Expand Down Expand Up @@ -737,7 +737,7 @@ bool try_icns(ReadInterface &ri, size_t length, ImageInfo &info) {
uint32_t entry_size = buffer.read_u32_be(4);
int64_t s = size_map.at(type);
entry_sizes.emplace_back(s, s);
max_size = std::max(max_size, s);
max_size = (std::max)(max_size, s);
offset += entry_size;
}

Expand Down

0 comments on commit 2215764

Please sign in to comment.