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>
const void* ContentLoaderBase::PTR_FOLLOWING = reinterpret_cast<void*>(-1);
const void* ContentLoaderBase::PTR_INSERT = reinterpret_cast<void*>(-2);
ContentLoaderBase::ContentLoaderBase(Zone& zone)
: varXString(nullptr),
m_zone(zone),

View File

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

View File

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

View File

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

View File

@ -7,6 +7,7 @@
#include <algorithm>
#include <cassert>
#include <cstring>
#include <memory>
class ProcessorAuthedBlocks final : public StreamProcessor
@ -49,7 +50,7 @@ public:
sizeToWrite = std::min(sizeToWrite, m_current_chunk_size - m_current_chunk_offset);
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;
m_current_chunk_offset += sizeToWrite;
}

View File

@ -2,6 +2,7 @@
#include <algorithm>
#include <cassert>
#include <cstring>
namespace
{
@ -25,7 +26,7 @@ namespace
auto loadedSize = m_base_stream->Load(&m_data[m_captured_data_size], dataToCapture);
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;

View File

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

View File

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

View File

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