From 61a5edd8372d2a702a57ec7be15c156be90d8bdf Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Tue, 23 Jul 2024 11:09:28 -0700 Subject: [PATCH] add comment about fts_open --- .../FileManager/FileOperations+Enumeration.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/FoundationEssentials/FileManager/FileOperations+Enumeration.swift b/Sources/FoundationEssentials/FileManager/FileOperations+Enumeration.swift index 8899672f9..b5f920f7c 100644 --- a/Sources/FoundationEssentials/FileManager/FileOperations+Enumeration.swift +++ b/Sources/FoundationEssentials/FileManager/FileOperations+Enumeration.swift @@ -168,6 +168,10 @@ struct _FTSSequence: Sequence { state = [Optional(UnsafeMutablePointer(mutating: path)), nil].withUnsafeBufferPointer { dirList in #if canImport(Android) + // The first parameter in `fts_open` in the Android NDK takes in a + // non-null char pointer, even though the last element in the array of pointers + // should be null. This cast resolves this nullability annotation that appears + // to be incorrect in the NDK. let baseAddress = unsafeBitCast(dirList.baseAddress!, to: UnsafePointer>.self) #else let baseAddress = dirList.baseAddress!