fix: linux build

This commit is contained in:
Jan Laupetin 2025-05-02 23:26:12 +02:00
parent b92e85dc14
commit 35cb6636a1
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C
9 changed files with 16 additions and 6 deletions

View File

@ -2,6 +2,9 @@
#include <cassert> #include <cassert>
const void* ContentLoaderBase::PTR_FOLLOWING = reinterpret_cast<void*>(-1);
const void* ContentLoaderBase::PTR_INSERT = reinterpret_cast<void*>(-2);
ContentLoaderBase::ContentLoaderBase(Zone& zone) ContentLoaderBase::ContentLoaderBase(Zone& zone)
: varXString(nullptr), : varXString(nullptr),
m_zone(zone), m_zone(zone),

View File

@ -6,8 +6,8 @@
class ContentLoaderBase class ContentLoaderBase
{ {
protected: protected:
static constexpr auto PTR_FOLLOWING = reinterpret_cast<void*>(-1); static const void* PTR_FOLLOWING;
static constexpr auto PTR_INSERT = reinterpret_cast<void*>(-2); static const void* PTR_INSERT;
public: public:
virtual ~ContentLoaderBase() = default; virtual ~ContentLoaderBase() = default;

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include <cstddef>
#include <cstdint> #include <cstdint>
class IHashProvider class IHashProvider

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include <cstddef>
#include <cstdint> #include <cstdint>
class ILoadingStream class ILoadingStream

View File

@ -7,6 +7,7 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <cstring>
#include <memory> #include <memory>
class ProcessorAuthedBlocks final : public StreamProcessor class ProcessorAuthedBlocks final : public StreamProcessor
@ -49,7 +50,7 @@ public:
sizeToWrite = std::min(sizeToWrite, m_current_chunk_size - m_current_chunk_offset); sizeToWrite = std::min(sizeToWrite, m_current_chunk_size - m_current_chunk_offset);
assert(length - loadedSize >= sizeToWrite); assert(length - loadedSize >= sizeToWrite);
memcpy(&static_cast<uint8_t*>(buffer)[loadedSize], &m_chunk_buffer[m_current_chunk_offset], sizeToWrite); std::memcpy(&static_cast<uint8_t*>(buffer)[loadedSize], &m_chunk_buffer[m_current_chunk_offset], sizeToWrite);
loadedSize += sizeToWrite; loadedSize += sizeToWrite;
m_current_chunk_offset += sizeToWrite; m_current_chunk_offset += sizeToWrite;
} }

View File

@ -2,6 +2,7 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <cstring>
namespace namespace
{ {
@ -25,7 +26,7 @@ namespace
auto loadedSize = m_base_stream->Load(&m_data[m_captured_data_size], dataToCapture); auto loadedSize = m_base_stream->Load(&m_data[m_captured_data_size], dataToCapture);
assert(length >= loadedSize); assert(length >= loadedSize);
memcpy(buffer, &m_data[m_captured_data_size], loadedSize); std::memcpy(buffer, &m_data[m_captured_data_size], loadedSize);
m_captured_data_size += loadedSize; m_captured_data_size += loadedSize;

View File

@ -5,6 +5,7 @@
#include <cassert> #include <cassert>
#include <condition_variable> #include <condition_variable>
#include <cstring>
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <optional> #include <optional>
@ -164,14 +165,14 @@ namespace
if (sizeToRead > bytesLeftInCurrentChunk) if (sizeToRead > bytesLeftInCurrentChunk)
{ {
assert(sizeToRead >= bytesLeftInCurrentChunk); assert(sizeToRead >= bytesLeftInCurrentChunk);
memcpy(bufferPos, &m_current_chunk[m_current_chunk_offset], bytesLeftInCurrentChunk); std::memcpy(bufferPos, &m_current_chunk[m_current_chunk_offset], bytesLeftInCurrentChunk);
loadedSize += bytesLeftInCurrentChunk; loadedSize += bytesLeftInCurrentChunk;
NextStream(); NextStream();
} }
else else
{ {
memcpy(bufferPos, &m_current_chunk[m_current_chunk_offset], sizeToRead); std::memcpy(bufferPos, &m_current_chunk[m_current_chunk_offset], sizeToRead);
loadedSize += sizeToRead; loadedSize += sizeToRead;
m_current_chunk_offset += sizeToRead; m_current_chunk_offset += sizeToRead;

View File

@ -2,6 +2,7 @@
#include "Loading/Exception/InvalidHashException.h" #include "Loading/Exception/InvalidHashException.h"
#include <cstring>
#include <memory> #include <memory>
namespace namespace

View File

@ -7,6 +7,7 @@
#include "Utils/Alignment.h" #include "Utils/Alignment.h"
#include <cassert> #include <cassert>
#include <cstring>
#include <stack> #include <stack>
namespace namespace