Update to objc2 v0.6 (#4092)
* Use available! macro * Use objc2-core-foundation and objc2-core-graphics * Use MainThreadBound instead of StaticMainThreadBound hack
This commit is contained in:
parent
f5dcd2aabe
commit
953d9b4268
25 changed files with 787 additions and 1103 deletions
|
|
@ -1,5 +1,8 @@
|
|||
use objc2_core_graphics::CGError;
|
||||
use tracing::trace;
|
||||
|
||||
use crate::error::OsError;
|
||||
|
||||
macro_rules! trace_scope {
|
||||
($s:literal) => {
|
||||
let _crate =
|
||||
|
|
@ -26,3 +29,12 @@ impl Drop for TraceGuard {
|
|||
trace!(target = self.module_path, "Completed `{}`", self.called_from_fn);
|
||||
}
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub(crate) fn cgerr(err: CGError) -> Result<(), OsError> {
|
||||
if err == CGError::Success {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(os_error!(format!("CGError {err:?}")))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue