Build failure in linux
Building in linux gives the following error
```Bash
/home/x/Zip/Zip/Zip.swift:219:61: error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>')
217 | let readBytes = unzReadCurrentFile(zip, &buffer, bufferSize)
218 | if readBytes > 0 {
219 | guard fwrite(buffer, Int(readBytes), 1, filePointer) == 1 else {
| |- error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>')
| |- note: coalesce using '??' to provide a default when the optional value contains 'nil'
| `- note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
220 | throw ZipError.unzipFail
221 | }
/home/x/Zip/Zip/Zip.swift:219:61: error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>')
217 | let readBytes = unzReadCurrentFile(zip, &buffer, bufferSize)
218 | if readBytes > 0 {
219 | guard fwrite(buffer, Int(readBytes), 1, filePointer) == 1 else {
| |- error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>')
| |- note: coalesce using '??' to provide a default when the optional value contains 'nil'
| `- note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
220 | throw ZipError.unzipFail
221 | }
/home/x/Zip/Zip/Zip.swift:219:61: error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>')
217 | let readBytes = unzReadCurrentFile(zip, &buffer, bufferSize)
218 | if readBytes > 0 {
219 | guard fwrite(buffer, Int(readBytes), 1, filePointer) == 1 else {
| |- error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>')
| |- note: coalesce using '??' to provide a default when the optional value contains 'nil'
| `- note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
220 | throw ZipError.unzipFail
221 | }
```
0 条评论