[ox] Get building in MSVC

This commit is contained in:
Gary Talent 2019-12-23 15:11:53 -06:00
parent a66f1499a4
commit 4cbf1b9a9a
7 changed files with 10 additions and 11 deletions

View File

@ -28,7 +28,8 @@ std::string PassThroughFS::basePath() {
Error PassThroughFS::mkdir(const char *path, bool recursive) {
bool success = false;
const auto p = m_path / stripSlash(path);
oxTrace("ox::fs::PassThroughFS::mkdir") << p.c_str();
const auto u8p = p.u8string();
oxTrace("ox::fs::PassThroughFS::mkdir") << u8p.c_str();
if (recursive) {
success = std::filesystem::create_directories(p);
} else {

View File

@ -89,9 +89,7 @@ class PassThroughFS: public FileSystem {
template<typename F>
ox::Error PassThroughFS::ls(const char *dir, F cb) {
for (auto &p : std::filesystem::directory_iterator(m_path / stripSlash(dir))) {
if (auto err = cb(p.path().filename().c_str(), 0); err) {
return err;
}
oxReturnError(cb(p.path().filename().u8string(), 0));
}
return OxError(0);
}

View File

@ -16,8 +16,8 @@ namespace ox {
class FieldPresenceIndicator {
private:
uint8_t *m_mask = nullptr;
int m_maskLen = 0;
int m_fields = 0;
std::size_t m_maskLen = 0;
std::size_t m_fields = 0;
public:
FieldPresenceIndicator(uint8_t *mask, std::size_t maxLen);

View File

@ -22,7 +22,8 @@
#else
#warn "Undefined hardware"
//TODO: fix warnning
//#warn "Undefined hardware"
#endif

View File

@ -8,7 +8,7 @@
#pragma once
#if OX_USE_STDLIB
#ifdef OX_USE_STDLIB
#include <cstddef>
#else
#define offsetof(type, member) __builtin_offsetof(type, member)

View File

@ -96,7 +96,7 @@ template<typename T1, typename T2>
int retval = -1;
for (std::size_t i = 0; i < maxLen && str[i]; i++) {
if (str[i] == character) {
retval = i;
retval = static_cast<int>(i);
}
}
return retval;
@ -106,7 +106,7 @@ template<typename T1, typename T2>
int retval = -1;
for (std::size_t i = 0; i < maxLen && str[i]; i++) {
if (str[i] == character) {
retval = i;
retval = static_cast<int>(i);
}
}
return retval;

View File

@ -10,7 +10,6 @@
#include <iomanip>
#include <iostream>
#include <stdio.h>
#include <unistd.h>
#endif
#include "trace.hpp"