Skip to content

[android] Fix Synchronization Android build #74160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion stdlib/public/Synchronization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ set(SWIFT_SYNCHRONIZATION_DARWIN_SOURCES
Mutex/DarwinImpl.swift
)

# Linux sources
# Linux and Android sources

set(SWIFT_SYNCHRONIZATION_LINUX_SOURCES
Mutex/LinuxImpl.swift
Expand Down Expand Up @@ -102,6 +102,8 @@ add_swift_target_library(swiftSynchronization ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES
Darwin
SWIFT_MODULE_DEPENDS_LINUX
Glibc
SWIFT_MODULE_DEPENDS_ANDROID
Android
SWIFT_MODULE_DEPENDS_WINDOWS
WinSDK

Expand Down
4 changes: 4 additions & 0 deletions stdlib/public/Synchronization/Mutex/LinuxImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
//===----------------------------------------------------------------------===//

import _SynchronizationShims
#if canImport(Android)
import Android
#else
import Glibc
#endif

extension Atomic where Value == UInt32 {
// This returns 'false' on success and 'true' on error. Check 'errno' for the
Expand Down