From bcbf2ace22d7f7c2b6a309b332f0ec353cd779f4 Mon Sep 17 00:00:00 2001 From: agra Date: Tue, 19 May 2026 19:29:03 +0300 Subject: [PATCH] ffi 1.25: uikit safeAreaInsets via #objc_call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First Phase 1D migration cluster. `uikit_refresh_safe_insets` reads `safeAreaInsets` through `#objc_call(UIEdgeInsets)` instead of the hand-typed `objc_msgSend` cast + `sel_registerName` triple, and a dead `sel_safe_insets` selector decl in `uikit_scene_will_connect_ios` goes away with it. Net -3 lines. iOS-sim chess regression smoke: SxChess launches, board renders with correct status-bar clearance — `safe_top` is populated correctly, which is the actual ABI under test (32 B HFA returned in v0..v3). --- library/modules/platform/uikit.sx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/library/modules/platform/uikit.sx b/library/modules/platform/uikit.sx index b4e8364..6cd0506 100644 --- a/library/modules/platform/uikit.sx +++ b/library/modules/platform/uikit.sx @@ -266,9 +266,7 @@ uikit_refresh_safe_insets :: (plat: *UIKitPlatform) { inline if OS != .ios { return; } if plat.gl_view == null { return; } - sel_safe := sel_registerName("safeAreaInsets".ptr); - msg_insets : (*void, *void) -> UIEdgeInsets = xx objc_msgSend; - i := msg_insets(plat.gl_view, sel_safe); + i := #objc_call(UIEdgeInsets)(plat.gl_view, "safeAreaInsets"); plat.safe_top = xx i.top; plat.safe_left = xx i.left; plat.safe_bottom = xx i.bottom; @@ -545,7 +543,6 @@ uikit_scene_will_connect_ios :: (delegate: *void, scene: *void) { sel_add_to_runloop := sel_registerName("addToRunLoop:forMode:".ptr); sel_current_runloop := sel_registerName("currentRunLoop".ptr); sel_tick := sel_registerName("sxTick:".ptr); - sel_safe_insets := sel_registerName("safeAreaInsets".ptr); msg_o : (*void, *void) -> *void = xx objc_msgSend; msg_v : (*void, *void) -> void = xx objc_msgSend;