HaxeFoundation / HaxeFoundation/hxcpp

Isn't it misleading to implement functions with dummy? Why not adding functions that checks if a CFFI function exists?

Open
#480 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
330
Forks
227
Avg merge
2d 16h
Merged PRs (30d)
18

Description

I expected `val_array_float` to work on neko, but actually it's not implemented for neko. It always returns NULL pointer. Why is this function implemented with dummy? Wouldn't it be better to let users check if that function exists? It's not very clear if argument cannot be converted to array for some reason, or it's not actually implemented on current CFFI. And It doesn't seem to possible to know which VM the app is currently running on.

https://github.com/HaxeFoundation/hxcpp/blob/de51e654e1180b4eadc8023cf70f82a28c93d18b/include/hx/CFFINekoLoader.h#L560

I've added some utility functions that allows you to define "extensions". I need to use some functions that only exists on C#, such as one that allocates specific type of C# Array, or one that fixes pointer of C# byte array until it's unfixed.

https://github.com/vroad/lime/blob/6d9576f8ec5003047b46a39a023b2f604cdf88d5/project/include/hx/CFFIExt.h

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.