From 5db33f40a24f8b47b8fe6cef6a4f487f3e1e96d3 Mon Sep 17 00:00:00 2001 From: eptx Date: Sun, 24 May 2026 08:14:10 -0400 Subject: [PATCH] thirdparty/libgc: gc.h uses GC_word instead of u64; valid standalone C (#27179) (#27201) --- thirdparty/libgc/include/gc.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/thirdparty/libgc/include/gc.h b/thirdparty/libgc/include/gc.h index e1ad0116e..0743d2e46 100644 --- a/thirdparty/libgc/include/gc.h +++ b/thirdparty/libgc/include/gc.h @@ -1,8 +1,16 @@ /* This file is installed for backward compatibility. */ #include "gc/gc.h" +/* Fix for vlang/v#27179: the original version of this file cast the + * pointer argument to V's `u64` type, which makes the header illegal + * to include from standalone C (any C shim doing `#include ` + * via V's -I@VEXEROOT/thirdparty/libgc/include path would fail with + * "unknown type: u64"). `GC_word` is the libgc-defined type that + * `GC_noop1` actually takes (gc/gc.h, typedef'd to uintptr_t on most + * platforms) — using it makes this header valid both from V code and + * from plain C shims. */ #ifndef _MSC_VER __attribute__ ((weak)) GC_API void GC_CALL GC_noop1_ptr(volatile void *p) { - GC_noop1((u64)p); + GC_noop1((GC_word)p); } #endif -- 2.39.5