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 1d4c010
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/int/specialized_div_rem/binary_long.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ macro_rules! impl_binary_long {
$normalization_shift:ident, // function for finding the normalization shift
$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`
$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 1d4c010

Please sign in to comment.