bytedeco/javacpp

How to parsing function pointer that has mutidimensional array parameter?

Open

#582 aberto em 17 de jun. de 2022

Ver no GitHub
 (4 comments) (0 reactions) (0 assignees)Java (620 forks)batch import
enhancementhelp wantedquestion

Métricas do repositório

Stars
 (4.279 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

// in header file

int (* testFunc)(char[][256] value);
// in generated java file

public static class TestFunc_BytePointer extends FunctionPointer {
    static { Loader.load(); }
    public TestFunc_BytePointer (Pointer p) { super(p); }
    protected TestFunc_BytePointer () { allocate(); }
    private native void allocate();

    public native int call(@Cast("char*") BytePointer errorList);
}
// generated native jni file

struct JavaCPP_hidden JavaCPP_org_bytedeco_test_ClassName_00024TestFunc_1BytePointer{
JavaCPP_org_bytedeco_test_ClassName_00024TestFunc_1BytePointer() : ptr(NULL), obj(NULL) { }
    int operator()(char* arg0);
    int (*ptr)(char* arg0);
    jobject obj; static jmethodID mid;
};

=> compile error error C2440: '=': cannot convert from 'int (__cdecl *)(char [][256])' to 'int (__cdecl *)(char *)'

Guia do colaborador