Skip to content

Commit

Permalink
fix code in order to support cmake unity builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tnixeu authored and patrick96 committed Oct 29, 2022
1 parent 10cdec3 commit ed6a0e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions include/modules/meta/base.inl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
#include <cassert>

#include "components/builder.hpp"
Expand Down
10 changes: 5 additions & 5 deletions src/ipc/encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ namespace ipc {
size_t total_size = HEADER_SIZE + payload.size();
std::vector<uint8_t> data(total_size);

auto* header = reinterpret_cast<ipc::header*>(data.data());
std::copy(ipc::MAGIC.begin(), ipc::MAGIC.end(), header->s.magic);
header->s.version = ipc::VERSION;
header->s.size = payload.size();
header->s.type = type;
auto* msg_header = reinterpret_cast<header*>(data.data());
std::copy(MAGIC.begin(), MAGIC.end(), msg_header->s.magic);
msg_header->s.version = VERSION;
msg_header->s.size = payload.size();
msg_header->s.type = type;

std::copy(payload.begin(), payload.end(), data.begin() + HEADER_SIZE);
return data;
Expand Down

0 comments on commit ed6a0e9

Please sign in to comment.