1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-08-19 15:39:46 +00:00

Buildfix on ARM raspberry pi

This commit is contained in:
King_DuckZ 2016-02-02 20:56:27 +01:00
parent c5824c36bd
commit 58c7e917c5
6 changed files with 80 additions and 24 deletions

View file

@ -27,6 +27,21 @@
namespace pq {
namespace implem {
template <
typename Expected,
typename Struct,
std::size_t ES=sizeof(Expected),
std::size_t EA=alignof(Expected),
std::size_t SS=sizeof(Struct),
std::size_t SA=alignof(Struct)
>
void static_assert_size() {
//static_assert(sizeof(PGparam*) == sizeof(void*), "Unexpected pointer size");
//static_assert(sizeof(PGresult*) == sizeof(void*), "Unexpected pointer size");
static_assert(ES == SS, "Wrong size for static memory");
static_assert(EA == SA, "Wrong alignment for static memory");
}
auto get_pqlib_c_type_struct<std::chrono::system_clock::time_point>::conv (const std::chrono::system_clock::time_point& parParam) -> type {
static_assert(sizeof(storage) == sizeof(PGtimestamp), "Wrong size for timestamp, please update DATA_SIZE");
static_assert(alignof(storage) == alignof(PGtimestamp), "Wrong alignment for timestamp, please update type");
@ -64,8 +79,7 @@ namespace pq {
get_pqlib_c_type_struct_arr::get_pqlib_c_type_struct_arr (const Connection& parConn) :
m_par(parConn.make_empty_params())
{
static_assert(sizeof(storage) == sizeof(PGarray), "Wrong size for PGarray's static memory");
static_assert(alignof(storage) == alignof(PGarray), "Wrong alignment for PGarray's static memory");
static_assert_size<PGarray, storage>();
PGarray arr;
std::fill(reinterpret_cast<char*>(&arr), reinterpret_cast<char*>(&arr) + sizeof(PGarray), '\0');