Skip to content

Instantly share code, notes, and snippets.

@remogatto
Created July 7, 2009 14:33
Show Gist options
  • Save remogatto/142110 to your computer and use it in GitHub Desktop.
Save remogatto/142110 to your computer and use it in GitHub Desktop.
require 'ffi-inliner'
module MyLib
extend Inliner
inline <<-c
void say_hello(char* name) { printf("Hello, %s\n", name); }
c
end
MyLib.say_hello('boys')
class Foo
include MyLib
end
Foo.new.say_hello('foos')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment