Skip to content

Commit

Permalink
Patch for windows compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
spoutn1k committed Nov 3, 2021
1 parent 75f7c45 commit 819a077
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/helper.h
Expand Up @@ -72,8 +72,8 @@ fs::path getTempDir();

// TODO Finesse this atrocity out of existence
template <typename F>
typename std::map<int, F>::iterator compatible(std::map<int, F> hash,
int version) {
typename std::map<int, F>::const_iterator
compatible(const std::map<int, F> &hash, int version) {
auto it = hash.rbegin();
int compatible = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/include/nbt/iterators.hpp
Expand Up @@ -285,7 +285,7 @@ template <typename NBTType> class iter {
}
}

bool operator!=(const iter &other) const { return not operator==(other); }
bool operator!=(const iter &other) const { return !operator==(other); }

bool operator<(const iter &other) const {
if (content != other.content) {
Expand Down
2 changes: 1 addition & 1 deletion src/include/nbt/nbt.hpp
Expand Up @@ -793,7 +793,7 @@ class NBT {

template <
typename PointerType,
typename std::enable_if<std::is_pointer<PointerType>::value and
typename std::enable_if<std::is_pointer<PointerType>::value &&
std::is_const<typename std::remove_pointer<
PointerType>::type>::value,
int>::type = 0>
Expand Down
2 changes: 1 addition & 1 deletion src/png.cpp
Expand Up @@ -119,7 +119,7 @@ void PNGWriter::_open() {
get_width(), get_height(), 8 * _bytesPerPixel,
file.string());

if (!(super::imageHandle = fopen(file.c_str(), "wb"))) {
if (!(super::imageHandle = fopen(file.string().c_str(), "wb"))) {
logger::error("[PNGWriter] Error opening '{}' for writing: {}\n",
file.string(), strerror(errno));
return;
Expand Down

0 comments on commit 819a077

Please sign in to comment.