Cairo.jl icon indicating copy to clipboard operation
Cairo.jl copied to clipboard

Provide macro @libcall to simplify ccall's

Open emmt opened this issue 5 years ago • 4 comments

A macro is provided to automatically use the correct library based on the prefix of the function. This makes the code a bit more readable and less prone to errors. The macro Cairo.@libcall can be used in other packages to simplify calling a Cairo/Pango function.

emmt avatar Oct 29 '20 11:10 emmt

Coverage Status

Coverage decreased (-1.06%) to 91.574% when pulling 823c57e3b04570303b4f9e0cc53216dbd9a045bf on emmt:eric-patch into 781dae0bb9783a7a5f51820d088d0b6554ffabe2 on JuliaGraphics:master.

coveralls avatar Oct 29 '20 11:10 coveralls

"and less prone to errors" - which errors?

lobingera avatar Oct 29 '20 12:10 lobingera

Well when the code is more clear and easier to read, I think that it less likely to make it wrong. I did not meant that that there were errors ;-)

emmt avatar Oct 29 '20 16:10 emmt

This now exists in Base's @ccall macro.

asinghvi17 avatar May 09 '24 12:05 asinghvi17

Agree this should be done with @ccall

ViralBShah avatar Aug 12 '24 18:08 ViralBShah