From 64e6fa93fd221d5b026c1841f44d2eb2400f307a Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sat, 9 Oct 2021 12:36:40 +0300 Subject: [PATCH] mdbx: fix `#pragma pack` to avoid misalignment for some compilers. Fixes https://github.com/erthink/libmdbx/issues/235. --- src/internals.h | 2 +- test/chrono.h | 2 +- test/config.h | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/internals.h b/src/internals.h index ad4f06ba..528519a9 100644 --- a/src/internals.h +++ b/src/internals.h @@ -437,7 +437,7 @@ typedef uint16_t indx_t; /*----------------------------------------------------------------------------*/ /* Core structures for database and shared memory (i.e. format definition) */ -#pragma pack(push, 1) +#pragma pack(push, 4) /* Information about a single database in the environment. */ typedef struct MDBX_db { diff --git a/test/chrono.h b/test/chrono.h index c51c538d..c622846f 100644 --- a/test/chrono.h +++ b/test/chrono.h @@ -19,7 +19,7 @@ namespace chrono { -#pragma pack(push, 1) +#pragma pack(push, 4) typedef union time { uint64_t fixedpoint; diff --git a/test/config.h b/test/config.h index f8ee52dc..785dcd4d 100644 --- a/test/config.h +++ b/test/config.h @@ -135,8 +135,6 @@ inline bool parse_option_intptr(int argc, char *const argv[], int &narg, //----------------------------------------------------------------------------- -#pragma pack(push, 1) - struct keygen_params_pod { /* Параметры генератора пар key-value. Также может быть полезным описание * алгоритма генерации в keygen.h @@ -307,8 +305,6 @@ struct actor_config_pod { wait4id(wait4id) {} }; -#pragma pack(pop) - extern const struct option_verb mode_bits[]; extern const struct option_verb table_bits[]; void dump(const char *title = "config-dump: ");