I tried using Dynamic type via haxe-c-bridge and it works! The most interesting part is happening due to memory alignment ( see printDynamicType function ).
Now I wonder if there is a better way to get ValueType ( outside of the Haxe code or by reducing the Haxe code ).
static public function getDynamicInt() {
var val:Int = -1;
var dyn:Any = val;
return dyn;
}
static public function getDynamicFloat() {
var val:Float = 99234234.99234234;
var dyn:Any = val;
return dyn;
}
static public function getDynamicType(dyn:Any) {
var idx = Type.typeof(dyn).getIndex();
var arr = Type.getEnumConstructs(Type.ValueType);
trace("HaxeEnumType = " + arr[idx]);
return idx;
}
Hello,
I tried using Dynamic type via haxe-c-bridge and it works! The most interesting part is happening due to memory alignment ( see printDynamicType function ).
Now I wonder if there is a better way to get ValueType ( outside of the Haxe code or by reducing the Haxe code ).
Edit:
I tested this using Win32 because I don't have 64 bit version of cl, can't compile 64bit version even gcc 64 bit version is used ( see https://github.com/haxiomic/haxe-c-bridge/issues/38 )
[ add to src/Main.hx at Main class ]
[ add to App.c ]