Skip to content

Commit c15cbb7

Browse files
[0.74] std::aligned_storage is deprecated (#14255)
* std::aligned_storage is deprecated (#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>
1 parent c52e293 commit c15cbb7

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "std::aligned_storage is deprecated",
4+
"packageName": "react-native-windows",
5+
"email": "30809111+acoates-ms@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

vnext/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ struct JsiAbiRuntime : facebook::jsi::Runtime {
283283
~ValueRef() noexcept;
284284
operator facebook::jsi::Value const &() const noexcept;
285285

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

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

310-
using StoreType = std::aligned_storage_t<sizeof(DataPointerValue)>;
312+
struct alignas(std::max_align_t) StoreType {
313+
std::byte buffer[sizeof(DataPointerValue)];
314+
};
311315

312316
private:
313317
StoreType m_pointerStore{};

0 commit comments

Comments
 (0)