mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-14 13:31:09 +00:00
tutorials/basic-tutorial-5: Make sure to only declare GDK C functions for the right platform
Otherwise linking might fail depending on the compiler flags if the linker does not remove all references to unused code.
This commit is contained in:
parent
881cdf2a5e
commit
dda55616dd
1 changed files with 5 additions and 2 deletions
|
@ -215,7 +215,8 @@ mod tutorial5 {
|
|||
}
|
||||
|
||||
let display_type_name = gdk_window.get_display().get_type().name();
|
||||
if cfg!(feature = "tutorial5-x11") {
|
||||
#[cfg(all(target_os = "linux", feature = "tutorial5-x11"))]
|
||||
{
|
||||
// Check if we're using X11 or ...
|
||||
if display_type_name == "GdkX11Display" {
|
||||
extern "C" {
|
||||
|
@ -233,7 +234,9 @@ mod tutorial5 {
|
|||
println!("Add support for display type '{}'", display_type_name);
|
||||
process::exit(-1);
|
||||
}
|
||||
} else if cfg!(feature = "tutorial5-quartz") {
|
||||
}
|
||||
#[cfg(all(target_os = "macos", feature = "tutorial5-quartz"))]
|
||||
{
|
||||
if display_type_name == "GdkQuartzDisplay" {
|
||||
extern "C" {
|
||||
pub fn gdk_quartz_window_get_nsview(
|
||||
|
|
Loading…
Reference in a new issue