Skip to content

Commit 9b00cea

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 2324acf commit 9b00cea

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
@@ -218,11 +218,12 @@ macro_rules! e {
218218
/// purpose is to calculate the correct enum values.
219219
///
220220
/// See <https://github.com/rust-lang/libc/issues/4419> for more.
221+
// FIXME(ctest): ctest doesn't recognize the `literal` fragment specifier.
221222
macro_rules! c_enum {
222223
(
223224
$(#[repr($repr:ty)])?
224225
$ty_name:ident {
225-
$($variant:ident $(= $value:literal)?,)+
226+
$($variant:ident $(= $value:expr /* literal */)?,)+
226227
}
227228
) => {
228229
pub type $ty_name = c_enum!(@ty $($repr)?);
@@ -233,7 +234,7 @@ macro_rules! c_enum {
233234
(@one; $_ty_name:ident; $_idx:expr;) => {};
234235
(
235236
@one; $ty_name:ident; $default_val:expr;
236-
$variant:ident $(= $value:literal)?,
237+
$variant:ident $(= $value:expr /* literal */)?,
237238
$($tail:tt)*
238239
) => {
239240
pub const $variant: $ty_name = {

0 commit comments

Comments
 (0)