Implement standard errors
This commit is contained in:
@ -54,6 +54,7 @@ fn main() {
|
||||
})
|
||||
.constified_enum("SlangProfileID")
|
||||
.constified_enum("SlangCapabilityID")
|
||||
.new_type_alias("SlangResult")
|
||||
.vtable_generation(true)
|
||||
.layout_tests(false)
|
||||
.derive_copy(true)
|
||||
|
@ -3,7 +3,7 @@
|
||||
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
||||
|
||||
use std::ffi::{c_char, c_int, c_void};
|
||||
|
||||
use std::fmt::{Display, Formatter};
|
||||
// Based on Slang version 2024.14.5
|
||||
|
||||
#[repr(C)]
|
||||
@ -135,3 +135,13 @@ pub struct IModuleVtable {
|
||||
pub getDependencyFilePath: unsafe extern "C" fn(*mut c_void, index: SlangInt32) -> *const c_char,
|
||||
pub getModuleReflection: unsafe extern "C" fn(*mut c_void) -> *mut slang_DeclReflection,
|
||||
}
|
||||
|
||||
impl Display for SlangResult {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
if self.0 > 0 {
|
||||
write!(f, "success")
|
||||
} else {
|
||||
write!(f, "failure")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user