Skip to content

Instantly share code, notes, and snippets.

@xqyww123
xqyww123 / class_warpper.cr
Created May 25, 2018 07:58
class_warpper.cr
lib LibPet
alias Pet = Void*
alias Dog = Void*
fun make_dog : Dog
fun bark(bar : Dog)
fun move(pet : Pet)
fun retreat(pet : Pet)
fun sell(pet : Pet)
end
@xqyww123
xqyww123 / rubyapi.cpp
Last active August 29, 2015 14:10
A patch to fix a bug in libmmseg for ruby
#include <fstream>
#include <string>
#include <iostream>
#include <cstdio>
#include <ctype.h>
#include <ruby.h>
/* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
#ifndef NUM2LL