Skip to content

Commit

Permalink
Fix check for Embedded (#60)
Browse files Browse the repository at this point in the history
Replaces use of `hasFeature(Embedded)` with `$Embedded` which properly
keys off the active compilation condition.
  • Loading branch information
rauhul authored Jan 4, 2024
1 parent d6e91ae commit 2053f59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/MMIO/BitFieldProjectable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public func preconditionMatchingBitWidth(
file: StaticString = #file,
line: UInt = #line
) {
#if hasFeature(Embedded)
#if $Embedded
// FIXME: Embedded doesn't have static interpolated strings yet
precondition(
fieldType.bitWidth == projectedType.bitWidth,
Expand Down
2 changes: 1 addition & 1 deletion Sources/MMIO/Register.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public struct Register<Value> where Value: RegisterValue {
@inlinable @inline(__always)
static func preconditionAligned(unsafeAddress: UInt) {
let alignment = MemoryLayout<Value.Raw.Storage>.alignment
#if hasFeature(Embedded)
#if $Embedded
// FIXME: Embedded doesn't have static interpolated strings yet
precondition(
unsafeAddress.isMultiple(of: UInt(alignment)),
Expand Down

0 comments on commit 2053f59

Please sign in to comment.