Skip to content

Commit

Permalink
Merge pull request #115 from p-x9/feature/spi-layout-wrapper
Browse files Browse the repository at this point in the history
Add some functions of `LayoutWrapper` to spi `Support`
  • Loading branch information
p-x9 authored Aug 19, 2024
2 parents 259b661 + bd036a2 commit 97a95b3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Sources/MachOKit/Protocol/LayoutWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,25 @@ extension LayoutWrapper {
}

extension LayoutWrapper {
static var layoutSize: Int {
@_spi(Support)
public static var layoutSize: Int {
MemoryLayout<Layout>.size
}

var layoutSize: Int {
@_spi(Support)
public var layoutSize: Int {
MemoryLayout<Layout>.size
}
}

extension LayoutWrapper {
static func layoutOffset(of key: PartialKeyPath<Layout>) -> Int {
@_spi(Support)
public static func layoutOffset(of key: PartialKeyPath<Layout>) -> Int {
MemoryLayout<Layout>.offset(of: key)!
}

func layoutOffset(of key: PartialKeyPath<Layout>) -> Int {
@_spi(Support)
public func layoutOffset(of key: PartialKeyPath<Layout>) -> Int {
MemoryLayout<Layout>.offset(of: key)!
}
}

0 comments on commit 97a95b3

Please sign in to comment.