17 lines
415 B
C++
17 lines
415 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <cstddef>
|
|
|
|
// Max 16MB per message
|
|
struct __attribute__((packed)) ppd_msg {
|
|
uint32_t size;
|
|
char data[0];
|
|
};
|
|
|
|
static constexpr int PPD_MSG_MAX_SZ = 1024 * 16 * 1024;
|
|
static constexpr int PPD_MSG_HDR_SZ = offsetof(ppd_msg, data);
|
|
static_assert(PPD_MSG_HDR_SZ == sizeof(struct ppd_msg));
|
|
static constexpr int PPD_MSG_MAX_DATA_SZ = (PPD_MSG_MAX_SZ - PPD_MSG_HDR_SZ);
|
|
|