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 Feb 22, 2024
1 parent 3ceda16 commit 1cf90fc
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/ui/linkage-attr/uikit-framework.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//! Check that linking to UIKit on platforms where that is available works.
//@ revisions: ios tvos watchos
//@ [ios]only-ios
//@ [tvos]only-tvos
//@ [watchos]only-watchos
//@ 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 1cf90fc

Please sign in to comment.