Fixed windows compilation

This commit is contained in:
KiritoDv
2023-08-17 15:10:35 -06:00
parent e0cc88e760
commit f3402d8c9f
3 changed files with 1236 additions and 3 deletions
+3 -2
View File
@@ -1,16 +1,17 @@
#include <dirent.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#if defined(_MSC_VER) || defined(__MINGW32__)
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32)
#include <io.h>
#include <sys/utime.h>
#include <nposix/dirent.h>
#else
#include <unistd.h>
#include <utime.h>
#include <dirent.h>
#endif
#include "utils.h"
+1231
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -3,6 +3,7 @@
extern "C" {
#include <libmio0/mio0.h>
}
#include <stdexcept>
std::unordered_map<uint32_t, std::vector<char>> MIO0Decoder::gCachedChunks;
@@ -11,7 +12,7 @@ std::vector<char>& MIO0Decoder::Decode(std::vector<uint8_t>& buffer, uint32_t of
mio0_header_t head;
if(!mio0_decode_header(in_buf, &head)){
throw std::runtime_error("Invalid MIO0 header");
throw std::runtime_error("Failed to decode MIO0 header");
}
uint8_t* decompressed = new uint8_t[head.dest_size];