From 417be15231cb34a2e858d26b63406d1fb5535cb9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Mar 2023 15:38:15 +0200 Subject: Replace deprecated std::aligned_storage with alignas Based on patch by Matthew Krupcale. --- libbuild2/variable.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libbuild2/variable.cxx') diff --git a/libbuild2/variable.cxx b/libbuild2/variable.cxx index 260d664..d55737b 100644 --- a/libbuild2/variable.cxx +++ b/libbuild2/variable.cxx @@ -3,7 +3,7 @@ #include -#include // memcmp() +#include // memcmp(), memcpy() #include @@ -57,7 +57,7 @@ namespace build2 else if (type->copy_ctor != nullptr) type->copy_ctor (*this, v, true); else - data_ = v.data_; // Copy as POD. + memcpy (data_, v.data_, size_); // Copy as POD. } } @@ -72,7 +72,7 @@ namespace build2 else if (type->copy_ctor != nullptr) type->copy_ctor (*this, v, false); else - data_ = v.data_; // Copy as POD. + memcpy (data_, v.data_, size_); // Copy as POD. } } @@ -106,7 +106,7 @@ namespace build2 else if (auto f = null ? type->copy_ctor : type->copy_assign) f (*this, v, true); else - data_ = v.data_; // Assign as POD. + memcpy (data_, v.data_, size_); // Assign as POD. null = v.null; } @@ -145,7 +145,7 @@ namespace build2 else if (auto f = null ? type->copy_ctor : type->copy_assign) f (*this, v, false); else - data_ = v.data_; // Assign as POD. + memcpy (data_, v.data_, size_); // Assign as POD. null = v.null; } -- cgit v1.1