Currently there is no support for native function calling for android on 64 bit platforms and I do not know enough assembly to even attempt trying to create a set of assembly calls myself. I've used the autowrapper provided in the addons of the sdk however I'm running into a bit of trouble.
The app runs fine on MSVC in both AS_MAX_PORTABILITY mode and using the native calling convention. However when I bring it to Android the native convention obviously doesn't work. I've wrapped my functions using this little ifdef.
#ifdef AS_MAX_PORTABILITY
#define pFUNCTION(f) WRAP_FN(f)
#define pFUNCTIONPR(f, p, r) WRAP_FN_PR(f, p, r)
#define pMETHOD(c, f) WRAP_MFN(c, f)
#define pMETHODPR(c, f, p, r) WRAP_MFN_PR(c, f, p, r)
#define pFUNCTION_OL_PR(f, p, r) WRAP_OBJ_LAST_PR(f, p, r)
#define pCALL_CDECL_OBJLAST asCALL_GENERIC
#define pCALL_CDECL asCALL_GENERIC
#define pCALL_THISCALL asCALL_GENERIC
#else
#define pFUNCTION(f) asFUNCTION(f)
#define pFUNCTIONPR(f, p, r) asFUNCTIONPR(f, p, r)
#define pMETHOD(c, f) asMETHOD(c, f)
#define pMETHODPR(c, f, p, r) asMETHODPR(c, f, p, r)
#define pFUNCTION_OL_PR(c, f, p, r) asFUNCTIONPR(c, f, p, r)
#define pCALL_CDECL_OBJLAST asCALL_CDECL_OBJLAST
#define pCALL_CDECL asCALL_CDECL
#define pCALL_THISCALL asCALL_THISCALL
#define pFUNCTION_OL_PR(name, Parameters, ReturnType) asFUNCTIONPR(name, Parameters, ReturnType)
#endif
Works fine on windows but has a segmentation fault on android. Is there anything that would cause this wrapper to behave differently on android?
P.S. Android.mk doesn't build just due to being compiled on incorrect architecture (file: as_callfunc_arm64_gcc.S) throwing a header guard in there fixes it but its no biggie. Excluding the file works aswell.
#if !defined(__ANDROID__) || (defined(__aarch64__) || defined(__x86_64__))