mdbx: support for building by GCC 4.8

Change-Id: I4ad5c5be60233ae68936e0cbca1a0f01ec786bad
This commit is contained in:
Leonid Yuriev
2020-09-13 19:50:53 +03:00
parent 1bc49f680d
commit 17d9ed31f9
6 changed files with 28 additions and 8 deletions

View File

@@ -475,14 +475,24 @@ const std::string actor_config::serialize(const char *prefix) const {
result.append(params.pathname_log);
result.push_back('|');
#if __cplusplus > 201400
static_assert(std::is_trivially_copyable<actor_params_pod>::value,
"actor_params_pod should by POD");
#else
static_assert(std::is_standard_layout<actor_params_pod>::value,
"actor_params_pod should by POD");
#endif
result.append(data2hex(static_cast<const actor_params_pod *>(&params),
sizeof(actor_params_pod), checksum));
result.push_back('|');
#if __cplusplus > 201400
static_assert(std::is_trivially_copyable<actor_config_pod>::value,
"actor_config_pod should by POD");
#else
static_assert(std::is_standard_layout<actor_config_pod>::value,
"actor_config_pod should by POD");
#endif
result.append(data2hex(static_cast<const actor_config_pod *>(this),
sizeof(actor_config_pod), checksum));
result.push_back('|');
@@ -527,8 +537,13 @@ bool actor_config::deserialize(const char *str, actor_config &config) {
TRACE("<< actor_config::deserialize: slash-3\n");
return false;
}
#if __cplusplus > 201400
static_assert(std::is_trivially_copyable<actor_params_pod>::value,
"actor_params_pod should by POD");
#else
static_assert(std::is_standard_layout<actor_params_pod>::value,
"actor_params_pod should by POD");
#endif
if (!hex2data(str, slash, static_cast<actor_params_pod *>(&config.params),
sizeof(actor_params_pod), checksum)) {
TRACE("<< actor_config::deserialize: actor_params_pod(%.*s)\n",
@@ -542,8 +557,13 @@ bool actor_config::deserialize(const char *str, actor_config &config) {
TRACE("<< actor_config::deserialize: slash-4\n");
return false;
}
#if __cplusplus > 201400
static_assert(std::is_trivially_copyable<actor_config_pod>::value,
"actor_config_pod should by POD");
#else
static_assert(std::is_standard_layout<actor_config_pod>::value,
"actor_config_pod should by POD");
#endif
if (!hex2data(str, slash, static_cast<actor_config_pod *>(&config),
sizeof(actor_config_pod), checksum)) {
TRACE("<< actor_config::deserialize: actor_config_pod(%.*s)\n",