fix code in order to support cmake unity builds
This commit is contained in:
parent
10cdec3b9f
commit
ed6a0e90fb
@ -1,3 +1,4 @@
|
|||||||
|
#pragma once
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "components/builder.hpp"
|
#include "components/builder.hpp"
|
||||||
|
@ -11,11 +11,11 @@ namespace ipc {
|
|||||||
size_t total_size = HEADER_SIZE + payload.size();
|
size_t total_size = HEADER_SIZE + payload.size();
|
||||||
std::vector<uint8_t> data(total_size);
|
std::vector<uint8_t> data(total_size);
|
||||||
|
|
||||||
auto* header = reinterpret_cast<ipc::header*>(data.data());
|
auto* msg_header = reinterpret_cast<header*>(data.data());
|
||||||
std::copy(ipc::MAGIC.begin(), ipc::MAGIC.end(), header->s.magic);
|
std::copy(MAGIC.begin(), MAGIC.end(), msg_header->s.magic);
|
||||||
header->s.version = ipc::VERSION;
|
msg_header->s.version = VERSION;
|
||||||
header->s.size = payload.size();
|
msg_header->s.size = payload.size();
|
||||||
header->s.type = type;
|
msg_header->s.type = type;
|
||||||
|
|
||||||
std::copy(payload.begin(), payload.end(), data.begin() + HEADER_SIZE);
|
std::copy(payload.begin(), payload.end(), data.begin() + HEADER_SIZE);
|
||||||
return data;
|
return data;
|
||||||
|
Loading…
Reference in New Issue
Block a user