From 4bd1cf2376a25b14a28103db639707bbd99a44d0 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Sun, 2 Jun 2024 21:16:44 +0800 Subject: [PATCH] rework ctypes with gcc 14 (#23636) --- compiler/ccgcalls.nim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim index 8ec37bf59e..6b716f7595 100644 --- a/compiler/ccgcalls.nim +++ b/compiler/ccgcalls.nim @@ -319,6 +319,11 @@ proc genArg(p: BProc, n: PNode, param: PSym; call: PNode; result: var Rope; need addRdLoc(a, result) else: a = initLocExprSingleUse(p, n) + if param.typ.kind in abstractPtrs: + let typ = skipTypes(param.typ, abstractPtrs) + if typ.sym != nil and sfImportc in typ.sym.flags: + a.r = "(($1) ($2))" % + [getTypeDesc(p.module, param.typ), rdCharLoc(a)] addRdLoc(withTmpIfNeeded(p, a, needsTmp), result) #assert result != nil