Skip to content

Commit

Permalink
Change from $(,)? to $(,)* for ctest
Browse files Browse the repository at this point in the history
`ctest` sometimes reports a parsing failure but it isn't consistent (I
do not know why). Just use a less ideal older syntax for now, this is an
internal macro.
  • Loading branch information
tgross35 committed Nov 20, 2024
1 parent 2f931d9 commit 27ad994
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,14 @@ macro_rules! e {

// FIXME(ctest): ctest can't handle `const extern` functions, we should be able to remove this
// cfg completely.
// FIXME(ctest): ctest can't handle `$(,)?` so we use `$(,)*` which isn't quite correct.
cfg_if! {
if #[cfg(feature = "const-extern-fn")] {
/// Define an `unsafe` function that is const as long as `const-extern-fn` is enabled.
macro_rules! f {
($(
$(#[$attr:meta])*
pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)?) -> $ret:ty
pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty
$body:block
)*) => ($(
#[inline]
Expand All @@ -217,7 +218,7 @@ cfg_if! {
macro_rules! safe_f {
($(
$(#[$attr:meta])*
pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)?) -> $ret:ty
pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty
$body:block
)*) => ($(
#[inline]
Expand All @@ -231,7 +232,7 @@ cfg_if! {
macro_rules! const_fn {
($(
$(#[$attr:meta])*
$({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)?) -> $ret:ty
$({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty
$body:block
)*) => ($(
#[inline]
Expand All @@ -245,7 +246,7 @@ cfg_if! {
macro_rules! f {
($(
$(#[$attr:meta])*
pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)?) -> $ret:ty
pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty
$body:block
)*) => ($(
#[inline]
Expand All @@ -259,7 +260,7 @@ cfg_if! {
macro_rules! safe_f {
($(
$(#[$attr:meta])*
pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)?) -> $ret:ty
pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty
$body:block
)*) => ($(
#[inline]
Expand All @@ -273,7 +274,7 @@ cfg_if! {
macro_rules! const_fn {
($(
$(#[$attr:meta])*
$({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)?) -> $ret:ty
$({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty
$body:block
)*) => ($(
#[inline]
Expand Down

0 comments on commit 27ad994

Please sign in to comment.