Skip to content

Commit

Permalink
add comment about fts_open
Browse files Browse the repository at this point in the history
  • Loading branch information
hyp committed Jul 23, 2024
1 parent b99a449 commit 61a5edd
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<UnsafeMutablePointer<CChar>>.self)
#else
let baseAddress = dirList.baseAddress!
Expand Down

0 comments on commit 61a5edd

Please sign in to comment.