Call a function in a shared library: Difference between revisions

m
→‎{{header|Perl 6}}: Update to work with 64 bit IDs (fix segfault)
(→‎{{header|Perl 6}}: update for more strict type constraints)
m (→‎{{header|Perl 6}}: Update to work with 64 bit IDs (fix segfault))
Line 1,246:
See [[Call_a_function_in_a_shared_library#Delphi | Delphi]]
=={{header|Perl 6}}==
{{works with|Rakudo|2018.0311}}
<lang perl6>use NativeCall;
 
sub XOpenDisplay(Str $s --> int32int64) is native(libX11'X11') {*}
constant libX11 = '/usr/lib/x86_64-linux-gnu/libX11.so.6';
sub XCloseDisplay(int32int64 $i --> int32) is native(libX11'X11') {*}
 
sub XOpenDisplay(Str $s --> int32) is native(libX11) {*}
sub XCloseDisplay(int32 $i --> int32) is native(libX11) {*}
 
if try my $d = XOpenDisplay ":0.0" {
Line 1,259 ⟶ 1,257:
}
else {
say "No libraryX11 {libX11}library!";
say "Use this window instead --> ⬜";
}</lang>
{{out}}
<pre>ID = 12484286494722089782960</pre>
 
=={{header|Phix}}==
10,327

edits