@@ -248,13 +248,17 @@ macro generateDemangled(jlName, cName, param, retType, jlArgTypes...)
248248 Expr (:(:: ), esc (Symbol (" arg$i " )), T)
249249 end
250250 local jlCall = Expr (:(:: ), Expr (:call , esc (jlName), jlArgExprs... ), retTypeWParam)
251- local cArgExprs = [Expr (:(:: ), Symbol (" arg$i " ), T) for (i,T) in enumerate (cArgTypesWParams)]
251+ # Build ccall directly instead of using @ccall macro to avoid variable name conflicts
252+ local cArgNames = [Symbol (" arg$i " ) for i in 1 : length (cArgTypesWParams)]
252253 local LIBSPARSE = " /System/Library/Frameworks/Accelerate.framework/Versions" *
253254 " /A/Frameworks/vecLib.framework/libSparse.dylib"
254- local funcAndLibrary = Expr (:(.), LIBSPARSE, esc (cName))
255- local cCall = Expr (:(:: ), Expr (:call , funcAndLibrary, cArgExprs... ), retTypeWParam)
256- local ccallMarco = Expr (:macrocall , Symbol (" @ccall" ), :(LineNumberNode (@__LINE__ , @__FILE__ )), cCall)
257- return Expr (Symbol (" =" ), jlCall, ccallMarco)
255+ # Construct ccall((:cName, LIBSPARSE), retType, (argTypes...), args...)
256+ local cCallExpr = Expr (:call , :ccall ,
257+ Expr (:tuple , esc (cName), LIBSPARSE),
258+ retTypeWParam,
259+ Expr (:tuple , cArgTypesWParams... ),
260+ cArgNames... )
261+ return Expr (Symbol (" =" ), jlCall, cCallExpr)
258262end
259263
260264# sparse * (dense matrix)
0 commit comments