Add initial Lime hybrid support (Lime 2 + Lime legacy)

This commit is contained in:
Joshua Granick
2015-04-04 22:16:01 -07:00
parent 3153f47f22
commit b3b7d2c299
2 changed files with 20 additions and 0 deletions

View File

@@ -410,6 +410,21 @@ class System {
} }
#if hybrid
var init = load ("lime-legacy", "neko_init", 5);
if (init != null) {
loaderTrace ("Found nekoapi @ " + __moduleNames.get ("lime-legacy"));
init (function(s) return new String (s), function (len:Int) { var r = []; if (len > 0) r[len - 1] = null; return r; }, null, true, false);
} else {
throw ("Could not find NekoAPI interface.");
}
#end
__loadedNekoAPI = true; __loadedNekoAPI = true;
} }

View File

@@ -109,6 +109,11 @@ class ByteArray #if !js extends Bytes implements ArrayAccess<Int> implements IDa
var init = System.load ("lime", "lime_byte_array_init", 4); var init = System.load ("lime", "lime_byte_array_init", 4);
init (factory, slen, resize, bytes); init (factory, slen, resize, bytes);
#if hybrid
var init = System.load ("lime-legacy", "lime_byte_array_init", 4);
init (factory, slen, resize, bytes);
#end
} }
#end #end