Skip to content

Commit

Permalink
[0.74] std::aligned_storage is deprecated (microsoft#14255)
Browse files Browse the repository at this point in the history
* std::aligned_storage is deprecated (microsoft#14253)

* std::aligned_storage is deprecated

* Change files

* format

---------

Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com>

* update change file

---------

Co-authored-by: Tiago <tiagomacarios@users.noreply.github.com>
  • Loading branch information
acoates-ms and tiagomacarios authored Jan 8, 2025
1 parent c52e293 commit c15cbb7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "std::aligned_storage is deprecated",
"packageName": "react-native-windows",
"email": "30809111+acoates-ms@users.noreply.github.com",
"dependentChangeType": "patch"
}
8 changes: 6 additions & 2 deletions vnext/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ struct JsiAbiRuntime : facebook::jsi::Runtime {
~ValueRef() noexcept;
operator facebook::jsi::Value const &() const noexcept;

using StoreType = std::aligned_storage_t<sizeof(DataPointerValue)>;
struct alignas(std::max_align_t) StoreType {
std::byte buffer[sizeof(DataPointerValue)];
};
static void InitValueRef(JsiValueRef const &data, facebook::jsi::Value *value, StoreType *store) noexcept;

private:
Expand All @@ -307,7 +309,9 @@ struct JsiAbiRuntime : facebook::jsi::Runtime {
~PropNameIDRef() noexcept;
operator facebook::jsi::PropNameID const &() const noexcept;

using StoreType = std::aligned_storage_t<sizeof(DataPointerValue)>;
struct alignas(std::max_align_t) StoreType {
std::byte buffer[sizeof(DataPointerValue)];
};

private:
StoreType m_pointerStore{};
Expand Down

0 comments on commit c15cbb7

Please sign in to comment.