Skip to content

Instantly share code, notes, and snippets.

@tony-o
Created December 3, 2014 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tony-o/ed50c2ce5aa8c799c761 to your computer and use it in GitHub Desktop.
Save tony-o/ed50c2ce5aa8c799c761 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
use Inline;
sub add(Int $a, Int $b) is inline('C') returns Int {'
#include <stdio.h>
DLLEXPORT int add (int a, int b) {
printf("Adding %d + %d = %d", a, b, a + b);
return a + b;
}
'};
add(5,6).say;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment