Fix windows build issues

This commit is contained in:
2021-02-09 00:24:11 +01:00
parent e871a989b4
commit 9584ec77f1
2 changed files with 26 additions and 6 deletions

View File

@@ -13,9 +13,27 @@
namespace openVulkanoCpp
{
#ifdef _MSC_VER
using mode_t = unsigned short;
using ssize_t = int64_t;
#endif
namespace LibArchiveHelper
{
constexpr mode_t FILE_TYPE_MAP[] = { AE_IFMT, AE_IFREG, AE_IFDIR, AE_IFLNK, AE_IFBLK, AE_IFCHR, AE_IFIFO, AE_IFSOCK, AE_IFMT };
constexpr mode_t GetFileType(std::filesystem::file_type type)
{
switch (type)
{
case std::filesystem::file_type::regular: return AE_IFREG;
case std::filesystem::file_type::directory: return AE_IFDIR;
case std::filesystem::file_type::symlink: return AE_IFLNK;
case std::filesystem::file_type::block: return AE_IFBLK;
case std::filesystem::file_type::character: return AE_IFCHR;
case std::filesystem::file_type::fifo: return AE_IFIFO;
case std::filesystem::file_type::socket: return AE_IFSOCK;
}
return AE_IFMT;
}
constexpr std::filesystem::file_type GetFileType(mode_t type)
{
@@ -32,11 +50,6 @@ namespace openVulkanoCpp
return std::filesystem::file_type::unknown;
}
constexpr mode_t GetFileType(std::filesystem::file_type type)
{
return FILE_TYPE_MAP[static_cast<signed char>(type)];
}
template<bool BLOCK_WRITE = false>
inline ssize_t CopyArchiveData(struct archive* archiveReader, struct archive* archiveWriter)
{