From e651f7de39c2b83b653198efd020774aaa90cdaf Mon Sep 17 00:00:00 2001 From: Diana Perez Afanador Date: Mon, 24 Jan 2022 18:46:44 +0100 Subject: [PATCH 1/2] Fix an error when compiling a watchOS target not supporting Thread-local storage ([#7623](https://github.com/realm/realm-swift/issues/7623)) --- CHANGELOG.md | 1 + src/realm/impl/simulated_failure.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09720ef01a2..ae3bbb42940 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * If a list of objects contains links to objects not included in the synchronized partition, the indices contained in CollectionChangeSet for that list may be wrong ([#5164](https://github.com/realm/realm-core/issues/5164), since v10.0.0) * Sending a QUERY message may fail with `Assertion failed: !m_unbind_message_sent` ([#5149](https://github.com/realm/realm-core/pull/5149), since v11.8.0) * Subscription names correctly distinguish an empty string from a nullptr ([#5160](https://github.com/realm/realm-core/pull/5160), since v11.8.0) +* Fix an error when compiling a watchOS target not supporting Thread-local storage ([#7623](https://github.com/realm/realm-swift/issues/7623)) ### Breaking changes * None. diff --git a/src/realm/impl/simulated_failure.cpp b/src/realm/impl/simulated_failure.cpp index a15a3704f07..77d4df07368 100644 --- a/src/realm/impl/simulated_failure.cpp +++ b/src/realm/impl/simulated_failure.cpp @@ -168,7 +168,7 @@ bool SimulatedFailure::do_check_trigger(FailureType failure_type) noexcept return false; } -#if REALM_ARCHITECTURE_X86_32 && REALM_IOS +#if (REALM_ARCHITECTURE_X86_32 && REALM_IOS) || REALM_WATCHOS bool (*s_mmap_predicate)(size_t); #else thread_local bool (*s_mmap_predicate)(size_t); From 759cdb8c010d9dc86a373f2bfe5bed1a0f3f8647 Mon Sep 17 00:00:00 2001 From: Diana Perez Afanador Date: Wed, 26 Jan 2022 20:24:39 +0100 Subject: [PATCH 2/2] Add condition only for watchOS simulator target --- src/realm/impl/simulated_failure.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/realm/impl/simulated_failure.cpp b/src/realm/impl/simulated_failure.cpp index 77d4df07368..4cac2e90323 100644 --- a/src/realm/impl/simulated_failure.cpp +++ b/src/realm/impl/simulated_failure.cpp @@ -168,7 +168,7 @@ bool SimulatedFailure::do_check_trigger(FailureType failure_type) noexcept return false; } -#if (REALM_ARCHITECTURE_X86_32 && REALM_IOS) || REALM_WATCHOS +#if (REALM_ARCHITECTURE_X86_32 && REALM_IOS) || (REALM_ARCHITECTURE_X86_64 && REALM_WATCHOS) bool (*s_mmap_predicate)(size_t); #else thread_local bool (*s_mmap_predicate)(size_t);