Skip to content

Commit

Permalink
impl_binary_long allow to pass attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
klensy committed Aug 7, 2023
1 parent f9beeba commit 1ac3230
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/int/specialized_div_rem/binary_long.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ macro_rules! impl_binary_long {
$n:tt, // the number of bits in a $iX or $uX
$uX:ident, // unsigned integer type for the inputs and outputs of `$fn`
$iX:ident // signed integer type with same bitwidth as `$uX`
$(, $fun_attr:meta)* // attributes for the function
) => {
/// Computes the quotient and remainder of `duo` divided by `div` and returns them as a
/// tuple.
$(
#[$fun_attr]
)*
pub fn $fn(duo: $uX, div: $uX) -> ($uX, $uX) {
let mut duo = duo;
// handle edge cases before calling `$normalization_shift`
Expand Down
3 changes: 2 additions & 1 deletion src/int/specialized_div_rem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,5 +306,6 @@ impl_binary_long!(
u32_normalization_shift,
32,
u32,
i32
i32,
allow(dead_code)
);

0 comments on commit 1ac3230

Please sign in to comment.