From 42a9da992c31f180b73be9accbfad93d180967f2 Mon Sep 17 00:00:00 2001 From: Rauhul Varma Date: Fri, 17 Nov 2023 11:09:52 -0500 Subject: [PATCH] Make bits argument variadic (#18) 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. --- Sources/MMIO/MMIOMacros.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/MMIO/MMIOMacros.swift b/Sources/MMIO/MMIOMacros.swift index cb982cd0..e4dc3210 100644 --- a/Sources/MMIO/MMIOMacros.swift +++ b/Sources/MMIO/MMIOMacros.swift @@ -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) = +public macro Reserved(bits: Range...) = #externalMacro(module: "MMIOMacros", type: "ReservedMacro") @attached(accessor) -public macro ReadWrite(bits: Range, as: Any? = nil) = +public macro ReadWrite(bits: Range..., as: Any? = nil) = #externalMacro(module: "MMIOMacros", type: "ReadWriteMacro") @attached(accessor) -public macro ReadOnly(bits: Range, as: Any? = nil) = +public macro ReadOnly(bits: Range..., as: Any? = nil) = #externalMacro(module: "MMIOMacros", type: "ReadOnlyMacro") @attached(accessor) -public macro WriteOnly(bits: Range, as: Any? = nil) = +public macro WriteOnly(bits: Range..., as: Any? = nil) = #externalMacro(module: "MMIOMacros", type: "WriteOnlyMacro")