Skip to content

Commit

Permalink
Fixed Linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Nov 12, 2024
1 parent 48f2f4a commit e168140
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Sources/Bluetooth/ByteValue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ extension ByteValue where Self: Comparable {
lhs.withUnsafeBytes { (b1) in
rhs.withUnsafeBytes { (b2) in
_memcmp(
UnsafeRawPointer(b1.baseAddress),
UnsafeRawPointer(b2.baseAddress),
b1.baseAddress.flatMap { UnsafeRawPointer($0) }!,
b2.baseAddress.flatMap { UnsafeRawPointer($0) }!,
Self.length
) < 0
}
Expand All @@ -89,8 +89,8 @@ extension ByteValue where Self: Comparable {
lhs.withUnsafeBytes { (b1) in
rhs.withUnsafeBytes { (b2) in
_memcmp(
UnsafeRawPointer(b1.baseAddress),
UnsafeRawPointer(b2.baseAddress),
b1.baseAddress.flatMap { UnsafeRawPointer($0) }!,
b2.baseAddress.flatMap { UnsafeRawPointer($0) }!,
Self.length
) > 0
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/Bluetooth/Extensions/System.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ internal func _memcmp(
) -> Int32
#else
internal func _memcmp(
_ p1: UnsafeRawPointer?,
_ p2: UnsafeRawPointer?,
_ p1: UnsafeRawPointer,
_ p2: UnsafeRawPointer,
_ size: Int
) -> Int32 {
memcmp(p1, p2, size)
Expand Down
4 changes: 2 additions & 2 deletions Sources/BluetoothGAP/Extensions/System.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ internal func _memcmp(
) -> Int32
#else
internal func _memcmp(
_ p1: UnsafeRawPointer?,
_ p2: UnsafeRawPointer?,
_ p1: UnsafeRawPointer,
_ p2: UnsafeRawPointer,
_ size: Int
) -> Int32 {
memcmp(p1, p2, size)
Expand Down
4 changes: 2 additions & 2 deletions Sources/BluetoothGATT/Extensions/System.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ internal func _memcmp(
) -> Int32
#else
internal func _memcmp(
_ p1: UnsafeRawPointer?,
_ p2: UnsafeRawPointer?,
_ p1: UnsafeRawPointer,
_ p2: UnsafeRawPointer,
_ size: Int
) -> Int32 {
memcmp(p1, p2, size)
Expand Down
4 changes: 2 additions & 2 deletions Sources/BluetoothHCI/Extensions/System.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ internal func _memcmp(
) -> Int32
#else
internal func _memcmp(
_ p1: UnsafeRawPointer?,
_ p2: UnsafeRawPointer?,
_ p1: UnsafeRawPointer,
_ p2: UnsafeRawPointer,
_ size: Int
) -> Int32 {
memcmp(p1, p2, size)
Expand Down

0 comments on commit e168140

Please sign in to comment.