【发布时间】:2019-12-06 08:53:57
【问题描述】:
我正在尝试将 libzip 链接到 Raku,它使用 void struct 或没有主体的结构,如下所示:
struct zip;
typedef struct zip zip_t;
我以同样的方式在我的 Raku 程序中声明它:
class zip_t is repr('CStruct'){};
这失败了:
Class zip_t has no attributes, which is illegal with the CStruct representation.
我发现该错误的唯一参考是 MyHTML 中的 in this non-addressed issue。这可能会使其回归,但我真的不确定。有什么想法吗?
【问题讨论】:
-
如果它没有主体,你在 Raku 中就不需要它。它在 C 和 Raku 之间的 API 中是如何使用的?我怀疑你真正需要的只是一个指针。
标签: raku rakudo nativecall