| 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) |
| 2 | // from gir-files (https://github.com/gtk-rs/gir-files) |
| 3 | // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) |
| 4 | // DO NOT EDIT |
| 5 | |
| 6 | #![cfg(unix)] |
| 7 | |
| 8 | use gstreamer_gl_egl_sysrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 crate/::*; |
| 9 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::envrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/; |
| 10 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#; |
| 11 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#; |
| 12 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::{align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of()., size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().}; |
| 13 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path#; |
| 14 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::processrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/::{Commandrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Command#, Stdiorust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Stdio#}; |
| 15 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/; |
| 16 | use tempfilerust-analyzer cargo tempfile 3.24.0 crate/::Builderrust-analyzer cargo tempfile 3.24.0 Builder#; |
| 17 | |
| 18 | static PACKAGESrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 PACKAGES.: &[&str] = &["gstreamer-gl-egl-1.0"]; |
| 19 | |
| 20 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 21 | struct Compilerrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Compiler# { |
| 22 | pub argsrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Compiler#args.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, |
| 23 | } |
| 24 | |
| 25 | impl Compilerrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Compiler# { |
| 26 | pub fn newrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Compiler]new().() -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Compiler], Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#>> { |
| 27 | let mut args = get_varrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 get_var().("CC", "cc")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 28 | args.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().("-Wno-deprecated-declarations".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()); |
| 29 | // For _Generic |
| 30 | args.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().("-std=c11".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()); |
| 31 | // For %z support in printf when using MinGW. |
| 32 | args.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().("-D__USE_MINGW_ANSI_STDIO".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()); |
| 33 | args.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(get_varrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 get_var().("CFLAGS", "")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().); |
| 34 | args.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(get_varrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 get_var().("CPPFLAGS", "")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().); |
| 35 | args.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(pkg_config_cflagsrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 pkg_config_cflags().(PACKAGESrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 PACKAGES.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().); |
| 36 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Compiler] { argsrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Compiler#args. }) |
| 37 | } |
| 38 | |
| 39 | pub fn compilerust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Compiler]compile().(&self, src: &Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path#, out: &Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#>> { |
| 40 | let mut cmd = self.to_commandrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Compiler]to_command().(); |
| 41 | cmd.argrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]arg().(src); |
| 42 | cmd.argrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]arg().("-o"); |
| 43 | cmd.argrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]arg().(out); |
| 44 | let status = cmd.spawnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]spawn().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..waitrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Child]wait().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 45 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().status.successrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[ExitStatus]success().() { |
| 46 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("compilation command {cmd:?} failed, {status}").intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()); |
| 47 | } |
| 48 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 49 | } |
| 50 | |
| 51 | fn to_commandrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Compiler]to_command().(&self) -> Commandrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Command# { |
| 52 | let mut cmd = Commandrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Command#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]new().(&self.argsrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Compiler#args.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().0]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().); |
| 53 | cmd.argsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]args().(&self.argsrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Compiler#args.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().); |
| 54 | cmd |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | fn get_varrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 get_var().(name: &str, default: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#>> { |
| 59 | match envrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/::varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().(name) { |
| 60 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(value) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(shell_wordsrust-analyzer cargo shell-words 1.1.1 crate/::splitrust-analyzer cargo shell-words 1.1.1 split().(&value)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().), |
| 61 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(envrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/::VarErrorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/VarError#::NotPresentrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/VarError#NotPresent#) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(shell_wordsrust-analyzer cargo shell-words 1.1.1 crate/::splitrust-analyzer cargo shell-words 1.1.1 split().(default)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().), |
| 62 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(err) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{name} {err}").intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()), |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | fn pkg_config_cflagsrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 pkg_config_cflags().(packages: &[&str]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#>> { |
| 67 | if packages.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]is_empty().() { |
| 68 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().()); |
| 69 | } |
| 70 | let pkg_config = envrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/::var_osrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var_os().("PKG_CONFIG").unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#::fromrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/impl#[OsString][`From<&T>`]from().("pkg-config")); |
| 71 | let mut cmd = Commandrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Command#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]new().(pkg_config); |
| 72 | cmd.argrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]arg().("--cflags"); |
| 73 | cmd.argsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]args().(packages); |
| 74 | cmd.stderrrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]stderr().(Stdiorust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Stdio#::inheritrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Stdio]inherit().()); |
| 75 | let out = cmd.outputrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]output().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 76 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().out.statusrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Output#status..successrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[ExitStatus]success().() { |
| 77 | let (status, stdout) = (out.statusrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Output#status., Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8_lossy().(&out.stdoutrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Output#stdout.)); |
| 78 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("command {cmd:?} failed, {status:?}\nstdout: {stdout}").intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()); |
| 79 | } |
| 80 | let stdout = strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/::from_utf8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/converts/from_utf8().(&out.stdoutrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Output#stdout.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 81 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(shell_wordsrust-analyzer cargo shell-words 1.1.1 crate/::splitrust-analyzer cargo shell-words 1.1.1 split().(stdout.trimrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().) |
| 82 | } |
| 83 | |
| 84 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 85 | struct Layoutrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout# { |
| 86 | sizerust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout#size.: usize, |
| 87 | alignmentrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout#alignment.: usize, |
| 88 | } |
| 89 | |
| 90 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 91 | struct Resultsrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Results# { |
| 92 | /// Number of successfully completed tests. |
| 93 | passedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Results#passed.: usize, |
| 94 | /// Total number of failed tests (including those that failed to compile). |
| 95 | failedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Results#failed.: usize, |
| 96 | } |
| 97 | |
| 98 | impl Resultsrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Results# { |
| 99 | fn record_passedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]record_passed().(&mut self) { |
| 100 | self.passedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Results#passed. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 101 | } |
| 102 | fn record_failedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]record_failed().(&mut self) { |
| 103 | self.failedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Results#failed. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 104 | } |
| 105 | fn summaryrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]summary().(&self) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 106 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{} passed; {} failed", self.passedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Results#passed., self.failedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Results#failed.) |
| 107 | } |
| 108 | fn expect_total_successrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]expect_total_success().(&self) { |
| 109 | if self.failedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Results#failed. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 { |
| 110 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("OK: {}", self.summaryrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]summary().()); |
| 111 | } else { |
| 112 | panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("FAILED: {}", self.summaryrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]summary().()); |
| 113 | }; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 118 | fn cross_validate_constants_with_crust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 cross_validate_constants_with_c().() { |
| 119 | let mut c_constants: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#)> = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 120 | |
| 121 | for l in get_c_outputrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 get_c_output().("constant").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().linesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]lines().() { |
| 122 | let (name, value) = l.split_oncerust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split_once().(';').expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]expect().("Missing ';' separator"); |
| 123 | c_constants.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().((name.to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(), value.to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().())); |
| 124 | } |
| 125 | |
| 126 | let mut results = Resultsrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Results#::defaultrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results][Default]default().(); |
| 127 | |
| 128 | for ((rust_name, rust_value), (c_name, c_value)) in |
| 129 | RUST_CONSTANTSrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 RUST_CONSTANTS..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(c_constants.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()) |
| 130 | { |
| 131 | if rust_name rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().c_name { |
| 132 | results.record_failedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]record_failed().(); |
| 133 | eprintlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/eprintln!!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}"); |
| 134 | continue; |
| 135 | } |
| 136 | |
| 137 | if rust_value rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().c_value { |
| 138 | results.record_failedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]record_failed().(); |
| 139 | eprintlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/eprintln!!( |
| 140 | "Constant value mismatch for {rust_name}\nRust: {rust_value:?}\nC: {c_value:?}", |
| 141 | ); |
| 142 | continue; |
| 143 | } |
| 144 | |
| 145 | results.record_passedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]record_passed().(); |
| 146 | } |
| 147 | |
| 148 | results.expect_total_successrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]expect_total_success().(); |
| 149 | } |
| 150 | |
| 151 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 152 | fn cross_validate_layout_with_crust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 cross_validate_layout_with_c().() { |
| 153 | let mut c_layouts = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 154 | |
| 155 | for l in get_c_outputrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 get_c_output().("layout").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().linesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]lines().() { |
| 156 | let (name, value) = l.split_oncerust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split_once().(';').expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]expect().("Missing first ';' separator"); |
| 157 | let (size, alignment) = value.split_oncerust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split_once().(';').expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]expect().("Missing second ';' separator"); |
| 158 | let size = size.parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().().expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Failed to parse size"); |
| 159 | let alignment = alignment.parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().().expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Failed to parse alignment"); |
| 160 | c_layouts.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().((name.to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(), Layoutrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout# { sizerust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout#size., alignmentrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout#alignment. })); |
| 161 | } |
| 162 | |
| 163 | let mut results = Resultsrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Results#::defaultrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results][Default]default().(); |
| 164 | |
| 165 | for ((rust_name, rust_layout), (c_name, c_layout)) in RUST_LAYOUTSrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 RUST_LAYOUTS..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(c_layouts.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()) |
| 166 | { |
| 167 | if rust_name rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().c_name { |
| 168 | results.record_failedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]record_failed().(); |
| 169 | eprintlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/eprintln!!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}"); |
| 170 | continue; |
| 171 | } |
| 172 | |
| 173 | if rust_layout rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().c_layout { |
| 174 | results.record_failedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]record_failed().(); |
| 175 | eprintlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/eprintln!!("Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}",); |
| 176 | continue; |
| 177 | } |
| 178 | |
| 179 | results.record_passedrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]record_passed().(); |
| 180 | } |
| 181 | |
| 182 | results.expect_total_successrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Results]expect_total_success().(); |
| 183 | } |
| 184 | |
| 185 | fn get_c_outputrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 get_c_output().(name: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#>> { |
| 186 | let tmpdir = Builderrust-analyzer cargo tempfile 3.24.0 Builder#::newrust-analyzer cargo tempfile 3.24.0 impl#[`Builder<'a, 'b>`]new().().prefixrust-analyzer cargo tempfile 3.24.0 impl#[`Builder<'a, 'b>`]prefix().("abi").tempdirrust-analyzer cargo tempfile 3.24.0 impl#[`Builder<'a, 'b>`]tempdir().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 187 | let exe = tmpdir.pathrust-analyzer cargo tempfile 3.24.0 dir/impl#[TempDir]path().().joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().(name); |
| 188 | let c_file = Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]new().("tests").joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().(name).with_extensionrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]with_extension().("c"); |
| 189 | |
| 190 | let cc = Compilerrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Compiler#::newrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Compiler]new().().expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("configured compiler"); |
| 191 | cc.compilerust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 impl#[Compiler]compile().(&c_file, &exe)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 192 | |
| 193 | let mut cmd = Commandrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Command#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]new().(exe); |
| 194 | cmd.stderrrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]stderr().(Stdiorust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Stdio#::inheritrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Stdio]inherit().()); |
| 195 | let out = cmd.outputrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[Command]output().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 196 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().out.statusrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Output#status..successrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/impl#[ExitStatus]success().() { |
| 197 | let (status, stdout) = (out.statusrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Output#status., Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8_lossy().(&out.stdoutrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Output#stdout.)); |
| 198 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("command {cmd:?} failed, {status:?}\nstdout: {stdout}").intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()); |
| 199 | } |
| 200 | |
| 201 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8().(out.stdoutrust-analyzer cargo std https://github.com/rust-lang/rust/library/std process/Output#stdout.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().) |
| 202 | } |
| 203 | |
| 204 | const RUST_LAYOUTSrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 RUST_LAYOUTS.: &[(&str, Layoutrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout#)] = &[ |
| 205 | ( |
| 206 | "GstGLDisplayEGL", |
| 207 | Layoutrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout# { |
| 208 | sizerust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout#size.: size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<GstGLDisplayEGLrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 GstGLDisplayEGL#>(), |
| 209 | alignmentrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout#alignment.: align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of().::<GstGLDisplayEGLrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 GstGLDisplayEGL#>(), |
| 210 | }, |
| 211 | ), |
| 212 | ( |
| 213 | "GstGLDisplayEGLClass", |
| 214 | Layoutrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout# { |
| 215 | sizerust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout#size.: size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<GstGLDisplayEGLClassrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 GstGLDisplayEGLClass#>(), |
| 216 | alignmentrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 Layout#alignment.: align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of().::<GstGLDisplayEGLClassrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 GstGLDisplayEGLClass#>(), |
| 217 | }, |
| 218 | ), |
| 219 | ]; |
| 220 | |
| 221 | const RUST_CONSTANTSrust-analyzer cargo gstreamer-gl-egl-sys 0.25.0 RUST_CONSTANTS.: &[(&str, &str)] = &[("GST_GL_DISPLAY_EGL_NAME", "gst.gl.display.egl")]; |