Skip to content

Commit 9b8ac55

Browse files
committed
macros: Work around ctest bugs
Some of our seemingly random failures probably come from this expansion. Work around ctest for now.
1 parent 46b90a8 commit 9b8ac55

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/macros.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,12 @@ macro_rules! e {
222222
/// purpose is to calculate the correct enum values.
223223
///
224224
/// See <https://github.com/rust-lang/libc/issues/4419> for more.
225+
// FIXME(ctest): ctest doesn't recognize the `literal` fragment specifier.
225226
macro_rules! c_enum {
226227
(
227228
$(#[repr($repr:ty)])?
228229
enum $ty_name:ident {
229-
$($variant:ident $(= $value:literal)?,)+
230+
$($variant:ident $(= $value:expr /* literal */)?,)+
230231
}
231232
) => {
232233
pub type $ty_name = c_enum!(@ty $($repr)?);
@@ -237,7 +238,7 @@ macro_rules! c_enum {
237238
(@one; $_ty_name:ident; $_idx:expr;) => {};
238239
(
239240
@one; $ty_name:ident; $default_val:expr;
240-
$variant:ident $(= $value:literal)?,
241+
$variant:ident $(= $value:expr /* literal */)?,
241242
$($tail:tt)*
242243
) => {
243244
pub const $variant: $ty_name = {

0 commit comments

Comments
 (0)