From 2df2e22546c07efb8f3f97c920facd40659a7cfc Mon Sep 17 00:00:00 2001 From: Rauhul Varma Date: Thu, 26 Oct 2023 15:23:44 -0700 Subject: [PATCH] Make bits argument variadic 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")