Skip to content

Instantly share code, notes, and snippets.

View pulsejet's full-sized avatar

Varun Patil pulsejet

View GitHub Profile
@pulsejet
pulsejet / float_div.patch
Created May 5, 2018 02:30
Patch to force 1/2 == 0 in mruby
From e36e2760f2c168c179a35cc8bf7a4103ce523f61 Mon Sep 17 00:00:00 2001
From: Rob Lyman <waveformdelta@gmail.com>
Date: Sat, 20 Jan 2018 13:52:04 -0600
Subject: [PATCH 1/2] Updated support for integer division behavior
This adds an adapted fix to give conditional integer division support,
based on the environment variable MRB_INTEGER_DIVISION. This adapts from
the previous fix to the latest stable mRuby branch, taking into
account their new MRB_WITHOUT_FLOAT environment variable.
@pulsejet
pulsejet / build_config.rb
Created May 5, 2018 02:29
Toolchain for building mruby with emscripten
# Sample usage
MRuby::CrossBuild.new('emscripten') do |conf|
toolchain :emscripten
# conf.gem :github => 'mattn/mruby-onig-regexp'
# conf.gem :github => 'take-cheeze/mruby-marshal'
conf.gembox 'default'
conf.cc do |cc|
cc.flags = [ENV['CFLAGS'] || %w()]
cc.compile_options = "%{flags} -O3 -MMD -o %{outfile} -c %{infile} -I$HOME/dev/onig/src"