1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
macro_rules! raw_fn {
($env:expr, $name:ident) => { {
(*$env.raw).$name.expect(stringify!(Required module function does not exist: $name))
}};
}
macro_rules! unsafe_raw_call_no_exit {
($env:expr, $name:ident $(, $args:expr)*) => {
unsafe {
let $name = raw_fn!($env, $name);
$name($env.raw $(, $args)*)
}
};
}
macro_rules! unsafe_raw_call {
($env:expr, $name:ident $(, $args:expr)*) => {
{
let env = $env;
let result = unsafe {
let $name = raw_fn!(env, $name);
$name(env.raw $(, $args)*)
};
env.handle_exit(result)
}
};
}
macro_rules! unsafe_raw_call_value {
($env:expr, $name:ident $(, $args:expr)*) => {
{
let result: $crate::Result<$crate::raw::emacs_value> = unsafe_raw_call!($env, $name $(, $args)*);
result.map(|raw| unsafe {
$crate::Value::new_protected(raw, $env)
})
}
};
}
#[macro_export]
#[allow(non_snake_case)]
macro_rules! plugin_is_GPL_compatible {
() => {
#[no_mangle]
#[allow(non_upper_case_globals)]
pub static plugin_is_GPL_compatible: ::std::os::raw::c_int = 0;
};
}
#[deprecated(since = "0.7.0", note = "Please use `emacs::plugin_is_GPL_compatible!` instead")]
#[doc(hidden)]
#[macro_export]
#[allow(non_snake_case)]
macro_rules! emacs_plugin_is_GPL_compatible {
($($inner:tt)*) => {
$crate::plugin_is_GPL_compatible!($($inner)*);
};
}