| Issue 149: | Cffi, NEKO_COMPATIBLE and alloc_null() | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Compile with NEKO_COMPATIBLE the following code:
value test_cffi()
{
return alloc_null();
}
DEFINE_PRIM(test_cffi, 0);
it runs fine on hxcpp, but on neko it fails. alloc_null() should return in a neko context not NULL, but neko's null value.
|
Hi, You need to call the following code from your library - nice and early before the values are actually required: #if neko public static function loadNekoAPI() { var init = load("neko_init", 5); if (init != null) { 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 This is not properly documented - sorry about that one.