Skip to content

Commit f45f92f

Browse files
daxpeddaelinorbgr
authored andcommitted
Allow handle to be an expression
1 parent ee44e56 commit f45f92f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub use libloading::{Library, Symbol};
156156
/// ```
157157
#[macro_export]
158158
macro_rules! ffi_dispatch(
159-
(feature=$feature: expr, $handle: ident, $func: ident, $($arg: expr),*) => (
159+
(feature=$feature: expr, $handle: expr, $func: ident, $($arg: expr),*) => (
160160
{
161161
#[cfg(feature = $feature)]
162162
let ret = ($handle.$func)($($arg),*);
@@ -166,7 +166,7 @@ macro_rules! ffi_dispatch(
166166
ret
167167
}
168168
);
169-
($handle: ident, $func: ident, $($arg: expr),*) => (
169+
($handle: expr, $func: ident, $($arg: expr),*) => (
170170
// NOTE: this "dlopen" refers to a feature on the crate *using* dlib
171171
$crate::ffi_dispatch!(feature="dlopen", $handle, $func, $($arg),*)
172172
);
@@ -190,7 +190,7 @@ macro_rules! ffi_dispatch(
190190
/// ```
191191
#[macro_export]
192192
macro_rules! ffi_dispatch_static(
193-
(feature=$feature: expr, $handle: ident, $name: ident) => (
193+
(feature=$feature: expr, $handle: expr, $name: ident) => (
194194
{
195195
#[cfg(feature = $feature)]
196196
let ret = $handle.$name;
@@ -200,7 +200,7 @@ macro_rules! ffi_dispatch_static(
200200
ret
201201
}
202202
);
203-
($handle:ident, $name: ident) => (
203+
($handle:expr, $name: ident) => (
204204
$crate::ffi_dispatch_static!(feature="dlopen", $handle, $name)
205205
);
206206
);

0 commit comments

Comments
 (0)