Closed bram-dingelstad closed 6 years ago
Nope this looks good, thanks for digging into it!
Nice! For anyone running into the issue with the Haxe standard library Context.hx
, here's an easy shell script that fixes that issue for you!
#!/bin/bash
file=""
for location in $(whereis haxe | cut -d : -f2-); do
file=$(find "$location" | grep macro\/Context.hx$)
if [[ "$file" != "" ]]; then
break
fi
done
sudo sed -i 's/#if neko/#if (neko || mobile)/g' "$file"
Using luxe commit version
66bed0cf1a38e58355c65497f8b97de5732467c5
Using haxe version3.4.4
I ran into this issue trying to use
snow.api.JNI
for a simple function thats executed from Java to Haxe using the@:build(JNI.native())
macro.The issue was at first that the
JNI.hx
file was usinghaxe.macros.Context
fields that didn't exist. Inspecting theContext.hx
file shows that the entire class is only available inneko
. On line 41 there is a compile time flag that only allows neko to use macros for some reason. I changed this to#if (neko || mobile)
for my purposes, this seems to be an issue with Haxe however, which has been reported. See the haxe issue hereThe second issue was an error saying:
I changed the static fields to
(default, never)
to fix this.The third issue was that I got an error saying:
I took a look at the
JNI.hx
file and corrected it to make sure it used a defined variable$name
. The variable passed to the cpp version of my haxe code only accepted::String
, notchar*
. I added a simple conversion (first time c++, i'm sorry) and fixed the issue with that.I there's anything that I can do to get this PR merged, let me know!
Cheers :smile: