Skip to content

Commit 61a5edd

Browse files
committed
add comment about fts_open
1 parent b99a449 commit 61a5edd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/FoundationEssentials/FileManager/FileOperations+Enumeration.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ struct _FTSSequence: Sequence {
168168

169169
state = [Optional(UnsafeMutablePointer(mutating: path)), nil].withUnsafeBufferPointer { dirList in
170170
#if canImport(Android)
171+
// The first parameter in `fts_open` in the Android NDK takes in a
172+
// non-null char pointer, even though the last element in the array of pointers
173+
// should be null. This cast resolves this nullability annotation that appears
174+
// to be incorrect in the NDK.
171175
let baseAddress = unsafeBitCast(dirList.baseAddress!, to: UnsafePointer<UnsafeMutablePointer<CChar>>.self)
172176
#else
173177
let baseAddress = dirList.baseAddress!

0 commit comments

Comments
 (0)