Skip to content

Commit 819a077

Browse files
committed
Patch for windows compatibility
1 parent 75f7c45 commit 819a077

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/helper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ fs::path getTempDir();
7272

7373
// TODO Finesse this atrocity out of existence
7474
template <typename F>
75-
typename std::map<int, F>::iterator compatible(std::map<int, F> hash,
76-
int version) {
75+
typename std::map<int, F>::const_iterator
76+
compatible(const std::map<int, F> &hash, int version) {
7777
auto it = hash.rbegin();
7878
int compatible = 0;
7979

src/include/nbt/iterators.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ template <typename NBTType> class iter {
285285
}
286286
}
287287

288-
bool operator!=(const iter &other) const { return not operator==(other); }
288+
bool operator!=(const iter &other) const { return !operator==(other); }
289289

290290
bool operator<(const iter &other) const {
291291
if (content != other.content) {

src/include/nbt/nbt.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ class NBT {
793793

794794
template <
795795
typename PointerType,
796-
typename std::enable_if<std::is_pointer<PointerType>::value and
796+
typename std::enable_if<std::is_pointer<PointerType>::value &&
797797
std::is_const<typename std::remove_pointer<
798798
PointerType>::type>::value,
799799
int>::type = 0>

src/png.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void PNGWriter::_open() {
119119
get_width(), get_height(), 8 * _bytesPerPixel,
120120
file.string());
121121

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

0 commit comments

Comments
 (0)