I have the following macro:
macro xprs_ccall(func, args...)
f = "XPRS$(func)"
args = map(esc,args)
is_unix() && return quote
ccall(($f,xprs), $(args...))
end
is_windows() && return quote
ccall(($f,xprs), stdcall, $(args...))
end
end
where xprs
is a const previously defined.
when I try:
@xprs_ccall(getversion, Cint, ( Ptr{Cchar}, ) , out)
I get:
ERROR: syntax: ccall argument types must be a tuple; try "(T,)"
I tested:
julia> macroexpand( :(@xprs_ccall(getversion, Cint, ( Ptr{Cchar}, ) , out)))
quote # REPL[5], line 10:
ccall(("XPRSgetversion", Main.xprs), Main.stdcall, Cint, (Ptr{Cchar},), out)
end
It seems to be a tuple…
When I remove the word stdcall from the macro:
macro xprs_ccall(func, args...)
f = "XPRS$(func)"
args = map(esc,args)
is_unix() && return quote
ccall(($f,xprs), $(args...))
end
is_windows() && return quote
ccall(($f,xprs), $(args...))
end
end
Everything works just fine.
Any Ideas why?