diff --git a/Sources/TSCLibc/libc.swift b/Sources/TSCLibc/libc.swift index 8c5c898e..5c29f971 100644 --- a/Sources/TSCLibc/libc.swift +++ b/Sources/TSCLibc/libc.swift @@ -15,6 +15,8 @@ #elseif os(Windows) @_exported import CRT @_exported import WinSDK +#elseif canImport(Android) +@_exported import Android #else @_exported import Darwin.C #endif diff --git a/Sources/TSCUtility/FSWatch.swift b/Sources/TSCUtility/FSWatch.swift index 5cea437b..79499e99 100644 --- a/Sources/TSCUtility/FSWatch.swift +++ b/Sources/TSCUtility/FSWatch.swift @@ -54,7 +54,7 @@ public class FSWatch { self._watcher = NoOpWatcher(paths: paths, latency: latency, delegate: _WatcherDelegate(block: block)) #elseif os(Windows) self._watcher = RDCWatcher(paths: paths, latency: latency, delegate: _WatcherDelegate(block: block)) - #elseif canImport(Glibc) || canImport(Musl) + #elseif canImport(Glibc) || canImport(Musl) || canImport(Android) var ipaths: [AbsolutePath: Inotify.WatchOptions] = [:] // FIXME: We need to recurse here. @@ -106,7 +106,7 @@ extension NoOpWatcher: _FileWatcher{} #elseif os(Windows) extension FSWatch._WatcherDelegate: RDCWatcherDelegate {} extension RDCWatcher: _FileWatcher {} -#elseif canImport(Glibc) || canImport(Musl) +#elseif canImport(Glibc) || canImport(Musl) || canImport(Android) extension FSWatch._WatcherDelegate: InotifyDelegate {} extension Inotify: _FileWatcher{} #elseif os(macOS) @@ -296,7 +296,7 @@ public final class RDCWatcher { } } -#elseif canImport(Glibc) || canImport(Musl) +#elseif canImport(Glibc) || canImport(Musl) || canImport(Android) /// The delegate for receiving inotify events. public protocol InotifyDelegate { diff --git a/Sources/TSCUtility/Tracing.swift b/Sources/TSCUtility/Tracing.swift index c32d6a5c..b53d26ca 100644 --- a/Sources/TSCUtility/Tracing.swift +++ b/Sources/TSCUtility/Tracing.swift @@ -92,7 +92,7 @@ public struct TracingEvent: TracingEventProtocol, Codable, Sendable { self.ts = ts self.startTs = startTs } - #elseif canImport(Glibc) + #elseif canImport(Glibc) || canImport(Android) public init( cat: String, name: String,