File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -803,8 +803,13 @@ extension FileManager {
803
803
let ps = UnsafeMutablePointer< UnsafeMutablePointer< Int8>?> . allocate( capacity: 2 )
804
804
ps. initialize ( to: UnsafeMutablePointer ( mutating: fsRep) )
805
805
ps. advanced ( by: 1 ) . initialize ( to: nil )
806
- let stream = ps. withMemoryRebound ( to: UnsafeMutablePointer< CChar> . self , capacity: 2 ) {
807
- fts_open ( $0, FTS_PHYSICAL | FTS_XDEV | FTS_NOCHDIR | FTS_NOSTAT, nil )
806
+ let stream = ps. withMemoryRebound ( to: UnsafeMutablePointer< CChar> . self , capacity: 2 ) { rebound_ps in
807
+ #if canImport(Android)
808
+ let arg = rebound_ps
809
+ #else
810
+ let arg = ps
811
+ #endif
812
+ return fts_open ( arg, FTS_PHYSICAL | FTS_XDEV | FTS_NOCHDIR | FTS_NOSTAT, nil )
808
813
}
809
814
ps. deinitialize ( count: 2 )
810
815
ps. deallocate ( )
@@ -1173,8 +1178,13 @@ extension FileManager {
1173
1178
defer { ps. deallocate ( ) }
1174
1179
ps. initialize ( to: UnsafeMutablePointer ( mutating: fsRep) )
1175
1180
ps. advanced ( by: 1 ) . initialize ( to: nil )
1176
- return ps. withMemoryRebound ( to: UnsafeMutablePointer< CChar> . self , capacity: 2 ) {
1177
- fts_open ( $0, FTS_PHYSICAL | FTS_XDEV | FTS_NOCHDIR | FTS_NOSTAT, nil )
1181
+ return ps. withMemoryRebound ( to: UnsafeMutablePointer< CChar> . self , capacity: 2 ) { rebound_ps in
1182
+ #if canImport(Android)
1183
+ let arg = rebound_ps
1184
+ #else
1185
+ let arg = ps
1186
+ #endif
1187
+ return fts_open ( arg, FTS_PHYSICAL | FTS_XDEV | FTS_NOCHDIR | FTS_NOSTAT, nil )
1178
1188
}
1179
1189
}
1180
1190
if _stream == nil {
You can’t perform that action at this time.
0 commit comments