Skip to content

Commit

Permalink
Add test for linking to UIKit
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Apr 10, 2024
1 parent 18d2434 commit ff3f0a3
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/ui/linkage-attr/uikit-framework.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//! Check that linking to UIKit on platforms where that is available works.
//@ revisions: ios tvos watchos visionos
//@ [ios]only-ios
//@ [tvos]only-tvos
//@ [watchos]only-watchos
//@ [visionos]only-visionos
//@ build-pass

use std::ffi::{c_char, c_int, c_void};

#[link(name = "UIKit", kind = "framework")]
extern "C" {
pub fn UIApplicationMain(
argc: c_int,
argv: *const c_char,
principalClassName: *const c_void,
delegateClassName: *const c_void,
) -> c_int;
}

pub fn main() {
unsafe {
UIApplicationMain(0, core::ptr::null(), core::ptr::null(), core::ptr::null());
}
}

0 comments on commit ff3f0a3

Please sign in to comment.