Skip to content

Commit

Permalink
Merge pull request #233 from tid-kijyun/feature/v5.2.1
Browse files Browse the repository at this point in the history
Feature/v5.2.1
  • Loading branch information
tid-kijyun authored Mar 26, 2020
2 parents e924895 + a6dd49f commit 0d51d5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
16 changes: 12 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

#if swift(>=5.2)
let provider: [SystemPackageProvider] = [
.apt(["libxml2-dev"]),
]
#else
let provider: [SystemPackageProvider] = [
.apt(["libxml2-dev"]),
.brew(["libxml2"]),
]
#endif

let package = Package(
name: "Kanna",
products: [
Expand All @@ -12,10 +23,7 @@ let package = Package(
name: "libxml2",
path: "Modules",
pkgConfig: "libxml-2.0",
providers: [
.apt(["libxml2-dev"]),
.brew(["libxml2"]),
]
providers: provider
),
.target(
name: "Kanna",
Expand Down
3 changes: 1 addition & 2 deletions Sources/Kanna/libxmlHTMLDocument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ final class libxmlHTMLDocument: HTMLDocument {
}

let url : String = ""
docPtr = cur.withUnsafeBytes { xmlReadDoc($0.bindMemory(to: xmlChar.self).baseAddress!, url, charsetName, CInt(option)) }

docPtr = cur.withUnsafeBytes { htmlReadDoc($0.bindMemory(to: xmlChar.self).baseAddress!, url, charsetName, CInt(option)) }
guard let docPtr = docPtr else {
throw ParseError.EncodingMismatch
}
Expand Down

0 comments on commit 0d51d5e

Please sign in to comment.