Skip to content

Commit

Permalink
Make bits argument variadic (#18)
Browse files Browse the repository at this point in the history
Adds a missing change from 'Add initial support for discontiguous bit
fields (#10)' which makes the 'bits' argument to the various bit field
macros variadic.
  • Loading branch information
rauhul committed Nov 17, 2023
1 parent a5b1c8c commit 42a9da9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/MMIO/MMIOMacros.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ public macro Register(bitWidth: Int) =
// external macro declarations. However, this parameter will never be used by
// expansion for reserved bitfields, so it is omitted to avoid programmer use.
@attached(accessor)
public macro Reserved(bits: Range<Int>) =
public macro Reserved(bits: Range<Int>...) =
#externalMacro(module: "MMIOMacros", type: "ReservedMacro")

@attached(accessor)
public macro ReadWrite(bits: Range<Int>, as: Any? = nil) =
public macro ReadWrite(bits: Range<Int>..., as: Any? = nil) =
#externalMacro(module: "MMIOMacros", type: "ReadWriteMacro")

@attached(accessor)
public macro ReadOnly(bits: Range<Int>, as: Any? = nil) =
public macro ReadOnly(bits: Range<Int>..., as: Any? = nil) =
#externalMacro(module: "MMIOMacros", type: "ReadOnlyMacro")

@attached(accessor)
public macro WriteOnly(bits: Range<Int>, as: Any? = nil) =
public macro WriteOnly(bits: Range<Int>..., as: Any? = nil) =
#externalMacro(module: "MMIOMacros", type: "WriteOnlyMacro")

0 comments on commit 42a9da9

Please # to comment.