[ox] MSVC fixes
This commit is contained in:
parent
868adae053
commit
7ee52db6a1
9
deps/ox/src/ox/logconn/logconn.cpp
vendored
9
deps/ox/src/ox/logconn/logconn.cpp
vendored
@ -7,12 +7,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef OX_USE_STDLIB
|
#ifdef OX_USE_STDLIB
|
||||||
#include <sys/socket.h>
|
#include <cstdio>
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
#include <sys/socket.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <cstdio>
|
#endif
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <ox/std/bit.hpp>
|
#include <ox/std/bit.hpp>
|
||||||
|
|
||||||
|
2
deps/ox/src/ox/model/fieldcounter.hpp
vendored
2
deps/ox/src/ox/model/fieldcounter.hpp
vendored
@ -67,7 +67,7 @@ consteval auto modelFieldCount() noexcept {
|
|||||||
auto t = a.allocate(1);
|
auto t = a.allocate(1);
|
||||||
detail::FieldCounter<T> c;
|
detail::FieldCounter<T> c;
|
||||||
const auto err = model(&c, t);
|
const auto err = model(&c, t);
|
||||||
oxAssert(err, "Count failed");
|
//oxAssert(err, "Count failed");
|
||||||
a.deallocate(t, 1);
|
a.deallocate(t, 1);
|
||||||
return c.fields;
|
return c.fields;
|
||||||
}
|
}
|
||||||
|
16
deps/ox/src/ox/model/modelhandleradaptor.hpp
vendored
16
deps/ox/src/ox/model/modelhandleradaptor.hpp
vendored
@ -25,10 +25,18 @@ class ModelHandlerInterface {
|
|||||||
|
|
||||||
template<typename T = std::nullptr_t>
|
template<typename T = std::nullptr_t>
|
||||||
constexpr ox::Error setTypeInfo(
|
constexpr ox::Error setTypeInfo(
|
||||||
const char *name = T::TypeName,
|
const char* name = T::TypeName,
|
||||||
int version = T::TypeVersion,
|
int version = T::TypeVersion,
|
||||||
const Vector<String> &typeParams = {},
|
const Vector<String>& typeParams = {}) noexcept {
|
||||||
std::size_t fields = ModelFieldCount_v<T>) noexcept {
|
return m_handler->template setTypeInfo<T>(name, version, typeParams, ModelFieldCount_v<T>);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T = std::nullptr_t>
|
||||||
|
constexpr ox::Error setTypeInfo(
|
||||||
|
const char* name,
|
||||||
|
int version,
|
||||||
|
const Vector<String>& typeParams,
|
||||||
|
std::size_t fields) noexcept {
|
||||||
return m_handler->template setTypeInfo<T>(name, version, typeParams, fields);
|
return m_handler->template setTypeInfo<T>(name, version, typeParams, fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
deps/ox/src/ox/oc/write.hpp
vendored
13
deps/ox/src/ox/oc/write.hpp
vendored
@ -187,9 +187,16 @@ class OrganicClawWriter {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr ox::Error setTypeInfo(
|
constexpr ox::Error setTypeInfo(
|
||||||
const char* = T::TypeName,
|
const char* = T::TypeName,
|
||||||
int = T::TypeVersion,
|
int = T::TypeVersion) noexcept {
|
||||||
const Vector<String>& = {},
|
return {};
|
||||||
std::size_t = ModelFieldCount_v<T>) noexcept {
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
constexpr ox::Error setTypeInfo(
|
||||||
|
const char*,
|
||||||
|
int,
|
||||||
|
const Vector<String>&,
|
||||||
|
std::size_t) noexcept {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
deps/ox/src/ox/preloader/alignmentcatcher.hpp
vendored
13
deps/ox/src/ox/preloader/alignmentcatcher.hpp
vendored
@ -28,9 +28,16 @@ struct AlignmentCatcher: public ModelHandlerBase<AlignmentCatcher<PlatSpec>> {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr ox::Error setTypeInfo(
|
constexpr ox::Error setTypeInfo(
|
||||||
const char* = T::TypeName,
|
const char* = T::TypeName,
|
||||||
int = T::TypeVersion,
|
int = T::TypeVersion) noexcept {
|
||||||
const Vector<String>& = {},
|
return {};
|
||||||
std::size_t = ModelFieldCount_v<T>) noexcept {
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
constexpr ox::Error setTypeInfo(
|
||||||
|
const char*,
|
||||||
|
int,
|
||||||
|
const Vector<String>&,
|
||||||
|
std::size_t) noexcept {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
15
deps/ox/src/ox/preloader/preloader.hpp
vendored
15
deps/ox/src/ox/preloader/preloader.hpp
vendored
@ -74,9 +74,16 @@ class Preloader: public ModelHandlerBase<Preloader<PlatSpec>> {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr ox::Error setTypeInfo(
|
constexpr ox::Error setTypeInfo(
|
||||||
const char* = T::TypeName,
|
const char* = T::TypeName,
|
||||||
int = T::TypeVersion,
|
int = T::TypeVersion) noexcept {
|
||||||
const Vector<String>& = {},
|
return {};
|
||||||
std::size_t = ModelFieldCount_v<T>) noexcept {
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
constexpr ox::Error setTypeInfo(
|
||||||
|
const char*,
|
||||||
|
int,
|
||||||
|
const Vector<String>&,
|
||||||
|
std::size_t) noexcept {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,7 +253,7 @@ constexpr ox::Error Preloader<PlatSpec>::field(CRStringView, const T **val, std:
|
|||||||
template<typename PlatSpec>
|
template<typename PlatSpec>
|
||||||
constexpr ox::Result<std::size_t> Preloader<PlatSpec>::startAlloc(std::size_t sz) noexcept {
|
constexpr ox::Result<std::size_t> Preloader<PlatSpec>::startAlloc(std::size_t sz) noexcept {
|
||||||
oxRequire(a, ox::allocate(&m_writer, sz));
|
oxRequire(a, ox::allocate(&m_writer, sz));
|
||||||
m_allocStack.emplace_back(m_writer.tellp());
|
m_allocStack.emplace_back(static_cast<PlatSpec::PtrType>(m_writer.tellp()));
|
||||||
oxReturnError(m_writer.seekp(a));
|
oxReturnError(m_writer.seekp(a));
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
13
deps/ox/src/ox/preloader/sizecatcher.hpp
vendored
13
deps/ox/src/ox/preloader/sizecatcher.hpp
vendored
@ -34,9 +34,16 @@ class SizeCatcher: public ModelHandlerBase<SizeCatcher<PlatSpec>> {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr ox::Error setTypeInfo(
|
constexpr ox::Error setTypeInfo(
|
||||||
const char* = T::TypeName,
|
const char* = T::TypeName,
|
||||||
int = T::TypeVersion,
|
int = T::TypeVersion) noexcept {
|
||||||
const Vector<String>& = {},
|
return {};
|
||||||
std::size_t = ModelFieldCount_v<T>) noexcept {
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
constexpr ox::Error setTypeInfo(
|
||||||
|
const char*,
|
||||||
|
int,
|
||||||
|
const Vector<String>&,
|
||||||
|
std::size_t) noexcept {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
deps/ox/src/ox/preloader/unionsizecatcher.hpp
vendored
13
deps/ox/src/ox/preloader/unionsizecatcher.hpp
vendored
@ -23,9 +23,16 @@ class UnionSizeCatcher: public ModelHandlerBase<UnionSizeCatcher<PlatSpec>> {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr ox::Error setTypeInfo(
|
constexpr ox::Error setTypeInfo(
|
||||||
const char* = T::TypeName,
|
const char* = T::TypeName,
|
||||||
int = T::TypeVersion,
|
int = T::TypeVersion) noexcept {
|
||||||
const Vector<String>& = {},
|
return {};
|
||||||
std::size_t = ModelFieldCount_v<T>) noexcept {
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
constexpr ox::Error setTypeInfo(
|
||||||
|
const char*,
|
||||||
|
int,
|
||||||
|
const Vector<String>&,
|
||||||
|
std::size_t) noexcept {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user