mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Add test for linking to UIKit
This commit is contained in:
parent
18d24349c6
commit
ff3f0a3467
25
tests/ui/linkage-attr/uikit-framework.rs
Normal file
25
tests/ui/linkage-attr/uikit-framework.rs
Normal file
@ -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());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user