From 9b00cea800b7583e04d7dea3d401c1acd64ac22f Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Mon, 2 Jun 2025 00:33:37 +0000 Subject: [PATCH] macros: Work around ctest bugs Some of our seemingly random failures probably come from this expansion. Work around ctest for now. --- src/macros.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index 12d3ab4b595c..8d289f376f4d 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -218,11 +218,12 @@ macro_rules! e { /// purpose is to calculate the correct enum values. /// /// See for more. +// FIXME(ctest): ctest doesn't recognize the `literal` fragment specifier. macro_rules! c_enum { ( $(#[repr($repr:ty)])? $ty_name:ident { - $($variant:ident $(= $value:literal)?,)+ + $($variant:ident $(= $value:expr /* literal */)?,)+ } ) => { pub type $ty_name = c_enum!(@ty $($repr)?); @@ -233,7 +234,7 @@ macro_rules! c_enum { (@one; $_ty_name:ident; $_idx:expr;) => {}; ( @one; $ty_name:ident; $default_val:expr; - $variant:ident $(= $value:literal)?, + $variant:ident $(= $value:expr /* literal */)?, $($tail:tt)* ) => { pub const $variant: $ty_name = {