From a4690ecb1fc8a9ac5f7dfccfdf9f67c7a74e1569 Mon Sep 17 00:00:00 2001 From: kcbanner Date: Sun, 20 Oct 2024 16:30:12 -0400 Subject: Cause a compilation error to occur if using @extern with is_dll_import in a comptime scope. Add a note about thread local / dll import being the cause. --- src/Value.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Value.zig') diff --git a/src/Value.zig b/src/Value.zig index 157f47bc7e..464ee7f5e1 100644 --- a/src/Value.zig +++ b/src/Value.zig @@ -1340,11 +1340,11 @@ pub fn isLazySize(val: Value, zcu: *Zcu) bool { }; } -pub fn isPtrToThreadLocal(val: Value, zcu: *Zcu) bool { +pub fn isPtrRuntimeValue(val: Value, zcu: *Zcu) bool { const ip = &zcu.intern_pool; const nav = ip.getBackingNav(val.toIntern()).unwrap() orelse return false; return switch (ip.indexToKey(ip.getNav(nav).status.resolved.val)) { - .@"extern" => |e| e.is_threadlocal, + .@"extern" => |e| e.is_threadlocal or e.is_dll_import, .variable => |v| v.is_threadlocal, else => false, }; -- cgit v1.2.3