From ac97e699f386c0a5e2f5761f8f9e991576892ede Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 10 May 2026 06:15:15 +0300 Subject: [PATCH] os: cast mutex storage to voidptr for -cstrict / FreeBSD CI --- vlib/os/execute_lock_nix.c.v | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vlib/os/execute_lock_nix.c.v b/vlib/os/execute_lock_nix.c.v index 5d889395a..dda75511a 100644 --- a/vlib/os/execute_lock_nix.c.v +++ b/vlib/os/execute_lock_nix.c.v @@ -10,14 +10,18 @@ module os // declared in builtin/cfns.c.v which take voidptr. __global g_v_os_execute_mutex_storage = [128]u8{} +fn v_os_execute_mutex_ptr() voidptr { + return unsafe { voidptr(&g_v_os_execute_mutex_storage[0]) } +} + fn init() { - C.pthread_mutex_init(&g_v_os_execute_mutex_storage[0], unsafe { nil }) + C.pthread_mutex_init(v_os_execute_mutex_ptr(), unsafe { nil }) } fn v_os_execute_lock() { - C.pthread_mutex_lock(&g_v_os_execute_mutex_storage[0]) + C.pthread_mutex_lock(v_os_execute_mutex_ptr()) } fn v_os_execute_unlock() { - C.pthread_mutex_unlock(&g_v_os_execute_mutex_storage[0]) + C.pthread_mutex_unlock(v_os_execute_mutex_ptr()) } -- 2.39.5