Debian Codegraph @

third_party/rust/cubeb-core/src/call.rs

raw
1 // Copyright © 2017-2018 Mozilla Foundation
2 //
3 // This program is made available under an ISC-style license. See the
4 // accompanying file LICENSE for details.
5 #![macro_use]
6
7 use std::os::raw::c_int;
8 use Error;
9
10 pub fn cvt_r(ret: c_int) -> Result<(), Error> {
11 match ret {
12 n if n < 0 => Err(Error::from_raw(n)),
13 _ => Ok(()),
14 }
15 }
16
17 macro_rules! call {
18 (ffi::$p:ident ($($e:expr),*)) => ({
19 ::call::cvt_r(ffi::$p($($e),*))
20 })
21 }