2
0
mirror of https://github.com/boostorg/uuid.git synced 2026-01-19 04:42:16 +00:00

Align uuid as uint64_t/__uint128_t

This commit is contained in:
Peter Dimov
2024-06-09 20:10:10 +03:00
parent f3100d7d80
commit c2bc3b3808
2 changed files with 17 additions and 2 deletions

View File

@@ -45,7 +45,20 @@ private:
{
private:
std::uint8_t repr_[ 16 ] = {};
union
{
std::uint8_t repr_[ 16 ];
#if !defined(BOOST_UUID_DISABLE_ALIGNMENT)
std::uint64_t align_u64_;
# if defined(__SIZEOF_INT128__)
__uint128_t align_u128_;
# endif
#endif
};
public:
@@ -70,7 +83,7 @@ public:
// data
data_type data;
data_type data = {};
public:

View File

@@ -2,6 +2,8 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#define BOOST_UUID_DISABLE_ALIGNMENT
#include <boost/uuid/uuid.hpp>
#include <boost/core/lightweight_test.hpp>
#include <cstddef>