Clean up legacy const_fn feature gates
This commit is contained in:
parent
4fe43f85d1
commit
6e9ba1cb96
|
|
@ -27,29 +27,8 @@ pub type BN_ULONG = u64;
|
||||||
#[cfg(target_pointer_width = "32")]
|
#[cfg(target_pointer_width = "32")]
|
||||||
pub type BN_ULONG = u32;
|
pub type BN_ULONG = u32;
|
||||||
|
|
||||||
#[cfg(const_fn)]
|
|
||||||
macro_rules! const_fn {
|
|
||||||
($(pub const fn $name:ident($($arg:ident: $t:ty),*) -> $ret:ty $b:block)*) => {
|
|
||||||
$(
|
|
||||||
pub const fn $name($($arg: $t),*) -> $ret $b
|
|
||||||
)*
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(not(const_fn))]
|
|
||||||
macro_rules! const_fn {
|
|
||||||
($(pub const fn $name:ident($($arg:ident: $t:ty),*) -> $ret:ty $b:block)*) => {
|
|
||||||
$(
|
|
||||||
pub fn $name($($arg: $t),*) -> $ret $b
|
|
||||||
)*
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const_fn! {
|
|
||||||
pub const fn ERR_PACK(l: c_int, f: c_int, r: c_int) -> c_ulong {
|
pub const fn ERR_PACK(l: c_int, f: c_int, r: c_int) -> c_ulong {
|
||||||
((l as c_ulong & 0x0FF) << 24) |
|
((l as c_ulong & 0x0FF) << 24) | ((f as c_ulong & 0xFFF) << 12) | (r as c_ulong & 0xFFF)
|
||||||
((f as c_ulong & 0xFFF) << 12) |
|
|
||||||
(r as c_ulong & 0xFFF)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn ERR_GET_LIB(l: c_uint) -> c_int {
|
pub const fn ERR_GET_LIB(l: c_uint) -> c_int {
|
||||||
|
|
@ -63,7 +42,6 @@ const_fn! {
|
||||||
pub const fn ERR_GET_REASON(l: c_uint) -> c_int {
|
pub const fn ERR_GET_REASON(l: c_uint) -> c_int {
|
||||||
(l & 0xFFF) as c_int
|
(l & 0xFFF) as c_int
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
pub fn init() {
|
pub fn init() {
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue