impl_binary_long allow to pass attribute
This commit is contained in:
parent
10f6ee84e3
commit
a15a3a5df0
2 changed files with 6 additions and 1 deletions
|
|
@ -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`
|
||||
|
|
|
|||
|
|
@ -306,5 +306,6 @@ impl_binary_long!(
|
|||
u32_normalization_shift,
|
||||
32,
|
||||
u32,
|
||||
i32
|
||||
i32,
|
||||
allow(dead_code)
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue